a) Music Class
For the host IP address, identify the prefix
192.168.20.10/??
Identify the LSB (least significant bit)
Identify the Subnet ID to which the host belongs
Identify the broadcast address
Identify the usable range of host IP addresses
Calculate Double or Triple
Write a program to print the triple of number
The first line is an integer
The output should be an integer based on the above conditions.
In the given example
N = 3, As 3 is a multiple of 3, we multiply the value by 3. So, the output should be 9.
Sample Input 1
3
Sample Output 1
9
Sample Input 2
4
Sample Output 2
8
Read information from following table carefully and check whether the following schedule contains a deadlock or not by constructing wait for graph?
A schedule S= {T1, T2, T3, T4, T5, T6, T7, T8} is shown with following information.
Transactions Holding Locks
Transaction waiting for Locks
Data item on which lock is required
T2------T1---A
T8----T3------B
T3-----T4------C
T4----T7------D
T5----T2-----X
T6----T8----Y
T3----T6----Z
Calculate Affinity Matrix on the base of given database, usage and access frequency information.
Database Information
Item
ID
Name
Price
Type
Expiry
Usage Information:
q1=select id,name,price from item
q2=select name,type,expiry from item
q3=select id,type from item where price>400
q4=select expiry,type,price from item where type=’soap’
q5=select name,type from item where expiry>15
q6=select name,expiry,id from item
Access Frequency Information
Site 1: q1(150), q2(000), q3(120), q4(300), q5(030), q6(500)
Site 2: q1(010), q2(230), q3(050), q4(250), q5(030), q6(140)
Site 3: q1(150), q2(130), q3(200), q4(110), q5(010), q6(220)
Site 4: q1(130), q2(700), q3(010), q4(230), q5(210), q6(100)
Write SQL queries for the given statements. Schema given below
Projects (CNIC, Name, Start_Date, End_Date, Type)
- Write a trigger which does not allow user to insert data in Projects table unless following constraints are met
a. CNIC must contain 13 digits
b. Name must contain only alphabets
c. Start_Date must be lesser than End_Date
d. Duration of Project must not be more than 5 months
e. Type can be either ‘Dev’, ‘Construction’, ‘Management’ or ‘Labor’.
f. Not more than 3 projects of same type must be inserted.
Given is the schema of a table and fragments created. Write down which of the correctness rules of fragmentation are violated (also write reason) for each part and also rewrite new fragments (at-least 3) for each part such that all correctness rules must be satisfied.
1- Employee (Eid, EName, eAge, eDesignation, eSalary)[ Salary must be more than 14000]
F1: eSalary > 14000 and eSalary < 20000
F2: eSalary >= 20000 and eSalary <=50000
F3: eSalary >=50000 and eSalary >= 100000
2- Book(Book_ISBN, bTitle, bPrice, bCategory) [bCategory must not be ‘CS’ or ‘IT’]
F1: bCategory = ‘Science’
F2: bCategory = ‘Novels’
F3: bCategory != ‘Science’
F4: bCategory != ‘CS’ or bCategory != ‘IT’
Given is the details of transaction’s start time and end time. Draw a table which shows what recovery operation will be taken by DBMS at each failure point for each transaction.
i- Deferred Updated
Transaction Name Start Time End Time
Ta t2 t9
Tb t1 t11
Tc t9 t18
Td t8 t15
Te t14 t19
Failure Points: t7, t10, t13, t20
Check Points: t6, t12, t17
Given are relational algebraic expressions. Perform given tasks for each.
· Write SQL statement for given queries.
· Convert Cartesian Product into Joins and vice versa.(convert only given queries in relational algebraic form)
i- (((sTSAL>=50000(Tutor))⟕TIDAssign)⋈C.cid=A.cid(sName=’DBS’ (Course))
ii- sTS.REGNO=R.REGNO^R.CCODE=C.CCODE (((sCGPA>3.0(STUDENT)) x (REG)) x (sCATEGORY='MATHS'(COURSE)))
Write a C program to print Hr:Min:Sec of clock using typedef
Develop a C program for File Operations that stores n number of the Alphabets from A to Z in a file and display it.