Information Technology > Quiz > INFO_2312_Assignment_2.doc.pdf (All)
Answer the questions with respect to the table below. users id name age gender occ_id city_id 1 John 25 M 1 3 2 Sara 20 F 3 4 3 Victor 31 M 2 5 4 Jane 27 F 1 3 occupation id name 1 Software E... ngineer 2 Accountant 3 Pharmacist 4 Library Assistant City id name 1 Halifax 2 Calgary 3 Boston 4 New York 5 Toronto This study source was downloaded by 100000840858457 from CourseHero.com on 07-07-2022 04:19:31 GMT -05:00 https://www.coursehero.com/file/65604756/INFO-2312-Assignment-2doc/(a) Create the three tables with their SQL queries and paste the code in text format below. Make sure while creating the tables: [5+2.5+2.5] Must have primary keys in all the tables. The attributes which can potentially be foreign keys must have NOT NULL Constraint. Gender attribute in users table should CHECK for ‘M’ or ‘F’. Users Table Query : CREATE TABLE users ( id int not null primary key, name varchar(50), age int, occ_id int not null, city_id int not null, gender TEXT CHECK (gender='M'OR (gender= 'F')) ); Occupation Table Query : CREATE TABLE occupation ( id serial PRIMARY KEY, name varchar(100) ); City Table Query : CREATE TABLE City ( id serial PRIMARY KEY, name varchar(50) ); [Show More]
Last updated: 1 year ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Add to cartInstant download
We Accept:
Connected school, study & course
About the document
Uploaded On
Aug 04, 2022
Number of pages
4
Written in
This document has been written for:
Uploaded
Aug 04, 2022
Downloads
0
Views
75
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·