Professional Documents
Culture Documents
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.
UserID
UserName
UserPassword
UserEmail
RegistrationDate
21. Type SQL statement to enter your record into the given table (stdID is Identity field).
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.
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.
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
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.
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
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.