Home Work

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

SQL Developer

Jan’ 03

1. What is Normalization?

2. Explain the three Normal Forms.

3. Explain the phases of Software development life cycle (SDLC).

Jan’ 04

1. What is a Composite Key?

2. What is a Foreign Key?

3. Explain the Relationships between tables.

4. List the SQL Server Versions.

5. List the SQL Server Editions with differences between each of them.

Jan’ 05

1. How to implement a many – to – much relationship in databases.

2. Why do we need multiple instances?

3. What is the maximum number of instances that could be created on one server?

4. Differences between default and named instances.

6. Is Windows Authentication or SQL Server Authentication more secure?

7. Explain DDL and DML statements with examples.

8. Using Alter statement, add and drop a column.

9. Explain the similarities and differences between Delete and Truncate statements.

10. List out the operators with examples.

11. List all the data types with their description and usage.
12. What are String, Date and Aggregate functions with Examples?

13. Explain the constraints in SQL Server.

Jan’ 07

1. Implement Constraints.

Jan’ 08

1. Why is only one primary key required for a table?

2. Differences between char and varchar data types, with each of its advantages and disadvantages.

3. How many unique keys can be created on a table?

4. Differences between char and nchar.

5. What does a schema mean and how is it useful? Why did Microsoft change the username to

schemaname in the four naming convention.

6. Create a table with the columns id and name. Write a query to display an output having a single

column with id and name separated by a hyphen.

7. Explain UNION, UNION ALL, INTERSECT, EXCEPT, CUBE and ROLLUP operators with examples.

8. Differences between UNION and UNION ALL operators.

9. Create a table Products with columns productid, productname and productprice. Also create

another table Orders with columns productid, orderid and some order details. Insert data into each

of them, ensuring that the Products table has a record for each product with a unique id.

10. Create a table Students with columns studentid, studentname and another table Subjects with

columns subjected and subjectname. Insert data into each of them. Write a cross join query on the

tables.

11. Create tables Products and Customers. Write a query to display the products that can be bought

by a customer.
12. Adventure Works

a. Retrieve all information from sales.salesorderheader table that are shipped in the year 2002.

b. Select list of people whose first name starts with character ‘A’ and last name has an ‘e’.

c. List the name and the number of employees in each department in the AdventureWorks database.

I am not interested in those departments that have less than one employee.

d. Find the average, maximum, minimum age of employees.

Jan’ 09

1. Differences between CAST and CONVERT functions.

2. Write a query to display all the products whether or not they have an order for it. Replace the

NULLs in the rows which do not have an order_id with 0.

3. What does each of the system databases master, model, msdb and tempdb mean?

4. What is the maximum size that can be stored in a table?

5. What is an Extent?

6. What is fragmentation and how would you avoid it?

7. What is a fill factor?

8. What is a covering index?

9. What are filtered indexes?

10. When will sub queries and joins be used in a query? What are the advantages and disadvantages

of using each of them over the other?

11. How to find the second top value of a column in table?

12. What is a heap?

13. Create a table Rent with columns Monthnames and RentAmmount. Insert data into the table.

Write a query to display paid if rentamount is paid in full, not paid if unpaid and not paid in full if

the total rent amount is not paid.


14. Write a query to display the EmployeeID, EmployeeName, ManagerID, ManagerName from the

AdventureWorks Database.

15. What are the advantages of views?

16. Insert and Delete rows from a View. Observes the changes.

17. What are indexed views? What are its advantages and disadvantages? What are the limitations

of creating an index on a view?

18. What are the differences between truncate and delete?

Jan’ 10

1. How to insert a value into an identity column?

2. What is the maximum size per row in a table?

3. Explain system tables and describe at least 10 of them.

4. Create a table (temporary) with columns Id and Name that may look like

Id Name
1 A
2 B
3 C
1 A
2 B
3 C
3 C
Write a query to display Id that has duplicate rows and the no. of occurrences of duplicates. The

output may look like,

Id No. of duplicate rows


1 2
2 2
3 3
Delete the duplicate rows of the table.

5. Explain the differences between table variables and temporary tables, with each of its advantages

and disadvantages over the other.


6. Explain the User Defined Functions – Scalar, Inline table-valued and Multi statement table-valued

functions with Examples.

7. What is a lock? Explain different types of locks.

8. What is a deadlock and how to avoid it?

9. What is a live lock?

10. Explain blocking.

11. Explain different isolation levels. What is the default isolation level in SQL Server?

12. What is Concurrency?

13. Without using a Create - Insert - Select sequence of creating a table based on an already existing

table, create a table using the Select statement alone.

14. How to create a view that doesn’t let it get dropped automatically by the deletion of the table it

depends on. (For the base table be dropped successfully, the view has to be dropped prior to it).

Jan’ 11

1. What are nested and recursive triggers? What is the maximum number of levels for nested and

recursive triggers.

2. What are the disadvantages of cursors?

3. What are the disadvantages of indexes?

4. Create a table called Cursors (id int, name char(10)) in every database.

5. Create two databases Uranus and Uranus_Hist. In each of the databases create a table Employee

with the columns (Id, Name, Address, City and State). The Employee table in Uranus_Hist database

has to have another column Ins_DateTime to record the date and time a row is inserted into it.

Implement a trigger on Employee table in Uranus database for an Update and Delete of rows in it

such that the old record i.e, the one before update (or) delete operation must be inserted into the

table in Uranus_Hist Database with timestamp in the Ins_DateTime column.


6. Create a table with columns Users with columns (id, name). Create a to trigger to populate the

columns inserted date, inserted user when an insertion is made and modified date and modified

user when an update is made to the record.

Jan’ 12

1. What are recursive Common Table Expressions (CTE).

2. What are Ranking (or) Analytical functions (Rank(), Dense_Rank(), Row_Number(), Ntile() )?

3. What is Bulk Insert Command?

4. What is BCP? What are the differences between Bulk Insert and BCP Commands?

5. Explain the Merge statement.

6. Write a query using CTE and Row_Number function to delete the duplicate rows.

7. Create tables’ t1, t2 and t3 with columns Id, Name, City and State. Insert values into the tables

such that the table t1 has the values only for Id and Name, table t2 has values for Id, Name, State

and table t3 has the values for Id, Name and City.

a. Update the records in table t1 with State in t2 and City in t3.

b. Delete the rows from the tables’ t2 and t3 that are not present in t1.

Jan’ 14

1. What are the differences between Stored Procedures and Functions?

2. When will a stored procedure recompile?

3. Document at least 10 system stored procedures.

4. What are user defined data types? What are its advantages and disadvantages?

5. What are PIVOT and UNPIVOT operators?

6. What are partitions in SQL Server?


Business Intelligence

SSRS
Jan’ 15

1. Create a report with Report Server Project Wizard on Employees table from AdventureWorks

database.

2. Create a report (with Report Designer) having alternate row colors.

Jan’17

1. Conditional Hiding

Create a report on SSRS table to display the rows having sales greater than 300.

2. Cascading Parameters

Create a table with columns (Country, State, City, Street). Insert values into the table to look like,

Country State City Street

USA New Jersey TeaNeck xxx

USA New Jersey TeaNeck yyy

USA New Jersey HackenSack xxx

USA New Jersey HackenSack yyy

USA California San Jose xxx

USA California San Jose yyy

USA California Santa Clara xxx

USA California Santa Clara yyy

India Andhra Pradesh Hyderbad xxx

India Andhra Pradesh Hyderabad yyy

Australia …. …. ….

Create a report to take parameters for Country, State, City and Street. Report has to generated by

giving parameter values one after the other filtering the data based on previous selection.

( Firstly, the parameter value for Country has to be selected among the values provided, say (USA,

India, Australia). Then for the selected Country, list of States in that Country has to be displayed. Next,

the Cities in the selected state would be displayed to choose)

3. Create a stored procedure for SSRS that takes State as a Parameter and passes multi values to the

procedure.

4. For questions 2 and 3, create a footer to display the parameter values entered.

Jan’ 18

1. Running Values of a Column

Create a report to display the columns from SSRS. The report must be grouped by State and also has to

have another column that calculates the running value of the sales column. The output may look

something like,

State Product Sales RunningValue

NJ Bicycle 100 100


Bike 500 600
Bicycle 300 900
NY Bicycle 100 1000
Bike 500 1500
Bicycle 300 1800
2. For the table SSRS,

a. Create a drill down report to see the product information (Not sales, only Product) on expanding the

State column. The Sales column has to be seen on expanding Product.

b. Create a drill up report.


3. How to have column headers repeated on all the data pages and make it scrollable down the

page?

Jan’ 19

1. Free Text Report

Create a report to repeat the employee details Employee Id, Employee Name, Title, Birth Date and

Qualification for every employee. Have a header ‘Employee Details’ for the Report. The Output may

look like,

Employee Details

Employee ID: …. Employee Name: ….


Title: …. Birth Date: ….
Qualification: ….

Employee ID: …. Employee Name: ….


Title: …. Birth Date: ….
Qualification: ….
.
.
.

2. Explain the architecture of SSRS 2008, describing each of its components.

3. What are the enhancements made in SSRS 2008 over 2005.

4. Why are sub reports used, when creating another data set could serve the purpose?

5. Create a report to display the page number in the footer.


SSIS
Jan’ 23

1. What is the difference between SQL Server Destination and OLE DB Destination?

2. Create a package on Employees table in AdventureWorks that would load data from

1 to <=100 in table1

100 to <=200 in table2

200 to <=290 in table 3

3. Create a flat file with Customer Id and Name. The Name in the flat file has to be the full name of

the employee with delimiter tab (or) | between first and last name.

Create a package to import the data from flat file to the database. The table in the database must

have the columns Customer Id, First Name and Last Name.

4. Find the expression to change the file name in the connection manager dynamically.

5. What is the difference between Merge and Union All data transformations?

Jan’ 24
1. Create a query to separate the first name and last name.

2. What are LookUp cache modes in SSIS and explain the difference between each of them.

3. Create a package to export the Row Count value to a file.

4. Create a package to LookUp the data in two tables’ source and reference. If there is a match, copy
the record to a table, say Match. For all the unmatched records, perform a Fuzzy LookUp with a
threshold limit of 50% to separate the records into two tables FuzzyMatch and Error.

5. Create a package to LookUp the data in two tables’ Source and Reference. If there is any match,
update the record in Transactions table and for no match insert the record in to the Transactions
table.

6. Create a package to Import and Export columns.


Jan’ 25

1. Create a package to load the flat files to an OLE DB destination. The files after loaded into the
database have to be moved to an archive. Use a ForEachLoop container.

Jan’ 27

1. How to make a temporary table available across multiple SQL tasks.

2. Create a flat file of Customer information with header and footer. Load the file to an OLE DB
destination, removing the header and footer off the flat file.

3. Create an Audit table with columns Load Id, File Name, Rows in the File, Rows Loaded, Rows
Rejected, Process Start Time, Process End Time. Create a package for Audit, running the package
would update the columns in Audit table..

SSAS
Jan’ 29

1. What are the advantages and disadvantages of Star and Snow Flake schemas?

2. What are degenerated dimensions?

3. What are shared dimensions?

4. What are role – playing dimensions?

5. What are semi–additive and non-additive facts?

You might also like