Orchid bank is a private sector bank which has branches in different countries. Orchid bank uses database for the storage of clients’ data because databases can store very large numbers of records efficiently. By using database, we can add, edit or delete data easily. It is more efficient in data searching and data sorting. Database can be used by more than one user to access same data simultaneously.
As a database designer, which type of database (distributed database & centralized database) you will use in this scenario to ensure data consistency, easy management and easy backup?
Also, what you think that replication of database suitable in the above given scenario?
Create a data sheet in MS Access which includes Employee ID, Employee Name, Father Name, Gender (Male, Female), Age, Date of Joining (dd-mm-yyyy), Address, Cell number (0300-0000000) and City (Karachi, Islamabad, Lahore).
Q.3. Develop an ER diagram for Salat management system (5 marks)
An analyst investigating University Student course registration system has found the following rules are applied by registration department:
All applications for course registrations received by the campus are checked by student affairs department. Student affairs first checks the pre requisite of the selected courses for each application and adds that credit to the student's fee balance. If the credit hour exceeds the limit defined for that program, student's application is rejected and is intimated to reselect the courses as per defined limit of credit hours. All such students who have selected the courses according to university policy their fee voucher is generated and that the fee voucher has been passed to the accounts manager who will contact them in the next three days. After the payment of fee, confirmation is to be sent by accounts manager through SMS. In case fee voucher is generated and is not collected by the student reminder message is sent reminding the student of the payment of fees. Construct a Decision Table for the described process.
Q.4. Answer the following as SQL queries. Also write corresponding relational algebra expression: (15 marks)
a. Number of rakats prayed as Qaza by each person
b. How many females have skipped fajar salah on 1st shawwal
c. How many salah are missed by Mr. Noman
d. Average time M. Noman takes for praying Isha Salah
e. Which salah is missed mostly by M. Saleem
f. Which salah is missed the second most by all people
Convert these queries to relational algebra expressions
a) select rackets
from Qaza
where NAME="A";
b) SELECT COUNT (name)
from female
where question1=Null
c) SELECT Count(SALAH)
From SALAH
WHERE follow=false
d) select AVG(time)
from prayer
where name ="M.Noman"
e) SELECT name
from slalah
where repetation=max
f) select name
from salah
where repetation<max
Q.3. Develop an ER diagram for Salat management system
a) Create a data sheet in MS Access which includes Employee ID, Employee Name, Father Name, Gender (Male, Female), Age, Date of Joining (dd-mm-yyyy), Address, Cell number (0300-0000000) and City (Karachi, Islamabad, Lahore).
b) Also create its Form and add at least 2 record through the form and create the following queries:
· List only those employees who belong to the city Karachi.
· Show only the female employee in the employee table
There should be at least 12 to 15 record in the table.
Please reply as fast as possible
III. Query questions. (COVERING 12 ITEM, 67 marks IN TOTAL)
Table:Movies
Id Title Director Year Length_minutes
1 Toy Story John Lasseter 1995 81
2 A Bug's Life John 1998 95
3 Toy Story 2 John Lasseter 1999 93
4 Monsters, Inc. Pete Docter 2001 92
5 Finding Nemo Andrew Stanto 2003 107
7 Cars John Lasseter 2006 117
9 WALL-E Andrew Stanton 2008 104
10 Up Pete Docter 2009 101
11 Toy Story 3 Lee Unkrich 2010 103
12 Cars 2 John Lasseter 2011 120
13 Brave Brenda Chapman 2012 102
87 WALL-G Brenda Chapman 2042 97
Table: Boxoffice
Movie_id Rating Domestic_sales International_sales
5 8.2 380843261 555900000
12 6.4 191452396 368400000
3 7.9 245852179 239163000
9 8.5 223808164 297503696
11 8.4 415004880 648167031
1 8.3 191796233 170162503
7 7.2 244082982 217900167
10 8.3 293004164 438338580
4 8.1 289916256 272900000
2 7.2 162798565 200600000
13 7.2 237283207 301700000
1. Create the table Movies. It includes the domain of values associated with each attribute and integrity constraints. (7 marks)
2. Write an SQL query that finds the title of each film.(5 marks)
3. Write an SQL query that finds the movies released in the years between 2000 and 2010 . (5 marks)
4. Find all the WALL-* movies. (5 marks)
5. List the last four Pixar movies released (ordered from most recent to least). (5 marks)
6. Find the domestic and international sales for each movie. (6 marks)
7. List all movies that were released on even number years. (5 marks)
8. Add the studio's new production, Toy Story 4 to the list of movies (you can use any director). (5 marks)
9. The director for A Bug's Life is incorrect, it was actually directed by John Lasseter. (5 marks)
10. This database is getting too big, lets remove all movies that were released before 2005. (5 marks)
11. SELECT title, year FROM movies WHERE year < 2000 OR year > 2010; (6 marks)
Write the result: