1-create the three tables with their SQL queries and paste the code in text format below. Make...
Question:
1-create the three tables with their SQL queries and paste the code in text format
below. Make sure while creating the tables:
• 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'
2- Can you please write 2 different types of
sql queries to find the users in city 'Boston'. Write 2
types of queries, one using joins to find the answer and another using
subqueries to find the same answer.
3- Can you please write sql query to find how many users are there per occupation.
4- Can you please Perform full outer join between users and city.
5- Can you please write query to make a copy of 'users' table known as 'users_new'.
CREATE TABLE users_new LIKE users;
6- Can you please write query to insert all columns of 'users' to the 'users_new'.
7- Can you please INSERT INTO users_new SELECT * FROM users;
Write CASE query to add one more column with salary values
to the 'users' table. Salary for Software engineer is 80,000, Accountant is 70,000 and
Pharmacist is 90,000.
8- Can you please write query to add foreign keys constraints to 'users' table.
9- Can you please add country column to 'city' table.
DEFAULT constraint must be used to add Canada as a default country for cities. [Use DEFAULT Constraint to default your country to Canada, that way you only have to write the countries for cities not in Canada,
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord