0% found this document useful (0 votes)
43 views

L9 SQL WS-2 - STD11

This document contains details of three tables - USER, PASSENGER, and TRAIN along with 50 questions related to database concepts. The tables contain sample data about users, passengers on trains, and train details. The questions cover concepts like creating tables, setting primary keys and foreign keys, inserting and deleting records, updating values, ordering and filtering results, and more.

Uploaded by

Hari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

L9 SQL WS-2 - STD11

This document contains details of three tables - USER, PASSENGER, and TRAIN along with 50 questions related to database concepts. The tables contain sample data about users, passengers on trains, and train details. The questions cover concepts like creating tables, setting primary keys and foreign keys, inserting and deleting records, updating values, ordering and filtering results, and more.

Uploaded by

Hari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DAV PUBLIC SCHOOL

L9 DATA BASE CONCEPTS (STD 11) SUB : IP WORKSHEET-2


Study the given below tables and answer the following questions

Table: USER

UID Password Security_question


[email protected] Seema My first school
[email protected] raghu My nick name
[email protected] rash Hope you know my name
[email protected] London My home town

Table: Passenger

PNR P_name P_age Gender UID Train_ID Seat_no


10023 Seema 23 F [email protected] WB7890 B21
10024 Raghav 45 M [email protected] AMD234 B33
10025 Rahul 37 M [email protected] PUN77 A55

Table: Train

Train_id T_name Train_type


WB7890 West Bengal express Non-A/c
PUN77 Pune Queen AC
AMD234 Ahmedabad Tej Express AC

1. Create table USER. Assume datatypes for the columns.


 Make UID as Primary Key,
 Password column should not be left blank.
2. Crete table PASSENGER.
 Make PNR column as unique and not null,
 check age should not be greater than 100,
 UID col as Foreign key referring to table USER (UID) col. Make sure changes made in
primary table must reflect in child table.
 Also make Train_Id and Foreign key referring to table TRAIN (Train_ID) col. Make sure
any record deleted in primary table must reflect in child table.
3. Crete table TRAIN
 Make Train_ID column as PK,
 Set the default val of train_type col as Non-A/c

4. What are comments in mysql? Explain its types.111


5. State difference between char and varchar datatypes.
6. Define: Datatypes, Literals
7. What is significance of NULL keyword in mysql.
8. WAQ to create database MyDB.
9. WAQ to enter inside the database MyDB. OR WAQ to open database namely MyDB.
10. WAQ to delete database MyDB
11. WAQ to view list of databases.
12. WAQ to view list of tables .
13. WAQ to see the structure of the table USER.

Study the following EMP tables and answer the queries below

14. WAQ to display the employees in the descending order of salary.


15. WAQ to display the employees whose sal is between 10000 and 20000.
16. WAQ to display the IT_Prog employees whose sal is not between 5000 to 9000
17. WAQ to delete Den’s record.
18. WAQ to display first name whose length is upto 3.
19. WAQ to display employees email whose second last letter is ‘a’
20. WAQ to display employees who do not earn commission.
21. WAQ to display employees who have join between 1-6-87 and 15-6-87
22. WAQ to display employee’s Financial account who earn more than 7500
23. WAQ to display employees who earn commission
24. WAQ to display employees who have join between 1-6-87 and 15-6-87 and names starting with
letter ‘D’.
25. WAQ to display employees in the ascending order by sal.
26. WAQ to display Advertisement president and Advertisement VP as job id.
27. Add a new col address to the above table.
28. Shift the column email after job_id
29. delete col phone number from the above table
30. Add primary key to employeeid
31. Make a copy of table and give new name of table as EMP_US
32. change the col title job_id to Job_CODE
33. WAQ to display employees other than PU_Man job_id
34. insert new record emp_id as 707 and Fisrt_name as ‘Bond’.
35. Add a new col incentive with int datatype and default value as 0
36. WAQ to display employee_id, first_name, last_name and salary of employees whose salary is greater
than or equal to 4000
37. WAQ to displays the first_name, last_name , salary and (salary+(salary*commission_pct)) as Net
Salary of employees whose Net Salary is in the range 10000 and 15000 and who gets atleast a
percentage of commission_pct.
38. How is ALTER command different from UPDATE.
39. Mention the difference between DROP and DELETE commands
40. Mention the two wild card characters in mysql.
41. What do you understand by column aliases. Give eg.
42.What is the significance of IFNULL() function.
43. What is the degree and cardinality of the employee table.
44. How is distinct different from ALL? State eg.
45. Mention the classifications of SQL commands. Give egs of each command.
46. State any one difference between ALTER Modify and ALTER Change
47. Which function is used to substitute NULL values in a query result?
48. Identify the error
DELETE ALL FROM EMP;
49. Identify the error
UPDATE TABLE EMP
SET SAL =SAL+100
50. Can a column defined with NOT NULL constraint, be skipped in an insert command? Elaborate your
answer.

You might also like