You are on page 1of 13

1. What is SSMS and what is the use of it?

2. What is other names of the field and records in a table?


3. What is importance of choosing the Optimal Data Type?
4. What is the difference between char, nchar, varchar and nvarchar?
5. List the Steps to design a table.
6. What are the uses of indexed fields?
7. What are the disadvantages of using index field?
8. What are the uses of the key fields?
9. What are the rules to identify the key fields?
10. In a table about books, which field naturally can be used as key field?
11. In a table about students, which field naturally can be used as key field?
12. In a table about students for the school fee field which data types can be used? Which is the
best option?
13. In a table about students for the student’s name field which data types can be used? Which is
the best option? Why?
14. In a table about students for the student’s birth date field which data types can be used? Which
is the best option?
15. Type the SQL script to implement the following table.
16. Type the SQL script to implement the following table.

17. In question 13, in the implementation of the table, how can you index the lastName and
firstName fields?
18. Type the SQL script to implement the following table.

19. What is the use of identity field?


20. Type the SQL script to implement the following table including the primary key, index fields and
unique field implementation. (All fields must be filled to register the system and registration
date will be collected automatically during the registration.)

UserID
UserName
UserPassword
UserEmail
RegistrationDate
21. Type SQL statement to enter your record into the given table (stdID is Identity field).

20. Type a query to see the following list.


21. Type a query to see the following list.

22. In the following table to update the highlighted field, type a query?

23. In the given table in the question 21, type a query to delete the second record.
24. To display the tblStudents table in the school database, in the windows form application with a
dataGridView controller, type the C# codes.
25. Following table is not in the 2NF, redesign it to meet the rules of 2NF.

BookID BookTitle Category Price


1 The Last of the President's Men History 19$
2 The Last of the President's Men History 30$
3 Betty Crocker the Big Book of Cookies Cooking 20$
4 How to Jumping Sport 25$
5 Anatomy Science 30$

26. Following table is not in the 1NF, redesign it to meet the rules of 1NF.

27. Following design is in the 1NF, but not in 2NF, redesign it to meet the rules of 2NF.
28. Type the SQL script to implement the following tables, including the relationship.

29. What is the form of the following table? Redesign it to improve.

EMPLOYEE_PHONE
SSN (PK) NAME PHONE1 PHONE2 PHONE3
123456789 Wiles, A. 1122334455 3344556677 6677889944
234567890 Newton, I. 3399118822 3399554773 NULL
345678901 Turing, A 2266001993 NULL NULL
456789012 Gauss, C.F. 4466577853 NULL NULL
30. List the type of the relationships and give example for the every type.
31. List the type of the constraints?
32. Give an example for NOT NULL constraints?
33. Give an example for CHECK constraints?
34. Give an example for UNIQUE constraints?
35. In Foreign key constraints, explain the options for ON DELETE clause.
36. Give an example for DEFAULT constraints?
37. In your business, if you are using the following invoices, design a data model to keep the track of
the all necessary data.
1. Make a database minimum with two tables to keep information related to students and
their passwords. (Consider the primary key fields, index fields and relationship between the
tables.)
2. Make a database to keep information related to students and their subjects. (Consider the
primary key fields, index fields and relationship between the tables.)
3. Make a database to keep information related to employees and their departments.
(Consider the primary key fields, index fields and relationship between the tables.)
4. Make a database to keep information related to books and their authors. (Consider the
primary key fields, index fields and relationship between the tables.)
5. Make a database to keep information related to books and their authors. (Consider the
primary key fields, index fields and relationship between the tables.)
6. Make the physical implementation of the following database. (Consider the primary key
fields, index fields and relationship between the tables and add more relevant fields to each

table at least one more for each tables.)


7. Make the physical implementation of the following database. (Consider the primary key
fields, index fields and relationship between the tables and add more relevant fields to each
table at least three more for each tables.)
8. Make the physical implementation of the following database. (Consider the primary key
fields, index fields and relationship between the tables.)

9. Type a query to display all fields from the all tables in the question 8.
10. Type a query to display all fields from the both tables in the question 7.
11. Type a query to display all fields from the both tables in the question 6.
12. List the type of the constraints in MS SQL server and give example for each one.
13. What is the use of join in MS SQL server and list the join types.
14.

department
departmentID DepartmentName Location
Phone
1 IT A Block 335-569
2 Computer Engineering B Block 335-570
3 Architecture C Block 335-571
4 Bioengineering D Block 335-572
a. From the first and second tables to obtain the following list type the query.
b. From the first and second tables to obtain the following list type the query.

c. From the first and second tables to obtain the following list type the query.

d. From the first and second tables to obtain the following list type the query.
15. What is the use of App.config file? How can you use it to set SQL connection settings?
16. Type the codes to display data from the multiple tables in a single dataGridView control?
17. Type the codes to display data from the multiple tables in the two different dataGridViews
in the Master / Detail fashion.
18. List the type of the functions in SQL server, and type scalar function which is return the birth
day when you enter your birthdate?
19. Write a scalar function to calculate Total price automatically in the table given below and
write the SQL script to make the following table and use the scalar function to calculate total
price.

ItemID ItemName UnitPrice QuantitySold TotalPrice


Board
1 Marker 3 5 15
2 Mouse 10 5 50
3 Keyboard 15 1 15
20. Type a table-valued function to obtain the second table from the first table.

21. Type a select query with COALESCE function to obtain the second table from the first table.
COALESCE function will assign the Nickname from the nickname or first name or last name
fields with a priority of the given order.
22. Type a select query with COALESCE function to obtain the second table from the first table.

23. Type a select query to obtain the second table from the first table.

go
SELECT * FROM tblStudents;
Go

SELECT stdID, firstName, lastName,


ROUND(height,2) AS RoundedHeight FROM
tblStudents;
24. Type a select query to obtain the second table from the first table.

Select firstName, lastName, birthDate,


DATEDIFF(YEAR, birthDate,getdate()) As
from tblStudents;

25. What are the limitations of views? Give one example to use of view.

26. What is the trigger and list the type of the triggers? Give one example to use of triggers.

You might also like