Dbms Lab Manual Print
Dbms Lab Manual Print
LABORATORY
PEO2: To enrich graduates with the core competencies necessary for applying knowledge of
computers and telecommunications equipment to store, retrieve, transmit, manipulate and analyze
data in the context of business enterprise.
PEO3: To enable graduates to think logically, pursue lifelong learning and will have the capacity to
understand technical issues related to computing systems and to design optimal solutions.
PEO4: To enable graduates to develop hardware and software systems by understanding the
importance of social, business and environmental needs in the human context.
PROGRAMME OUTCOMES:
Engineering Graduates will be able to:
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration
for the public health and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive clear
instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member and leader
in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
2. To manage complex IT projects with consideration of the human, financial, ethical and
environmental factors and an understanding of risk management processes, and operational and
policy implications.
FOR EXAMPLE
Aim of the experiment
Algorithms
Programme
Output
Results
After the completion of this course, students should be able to [Blooms Taxonomy]
C408.1 Create databases with different types of key constraints.
C408.2 Construct simple and complex SQL queries using DML and DCL commands..
C408.3 Use advanced features such as stored procedures and triggers and incorporate in GUI based
application development.
C408.4 Create an XML database and validate with meta-data (XML schema)
C408.5 Create and manipulate data using NOSQL database.
CO/PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO 3
C408.1 3 3 3 3 - - - - 3 1 3 2 2 3 2
C408.2 2 2 3 2 2 - - - 1 2 3 3 2 1 2
C408.3 3 3 2 1 1 - - - 1 1 1 3 2 3 3
C408.4 1 3 3 3 1 - - - 1 1 3 2 3 1 3
C408.5 3 2 1 1 1 - - - 2 2 3 1 3 1 2
AVG 2 3 2 2 1 - - - 2 1 3 2 2 2 2
LIST OF EXPERIMENTS
1. Create a database table, add constraints (primary key, unique, check, Not null), insert rows, update
2. Create a set of tables, add foreign key constraints and incorporate referential integrity.
3. Query the database tables using different ‘where’ clause conditions and also implement aggregate
functions.
4. Query the database tables and explore sub queries and simple join operations.
5. Query the database tables and explore natural, equi and outer joins.
8. Write SQL Triggers for insert, delete, and update operations in a database table.
9. Create View and index for database tables with a large number of records.
11. Create Document, column and graph based data using NOSQL database tools.
12. Develop a simple GUI based database application and incorporate all the above mentioned
features 13. Case Study using any of the real life database applications from the following list
AIM:
To create a database and how to perform the operations and add constraints.
ALGORITHM:
PROGRAM:
1. CREATE
2. ALTER
3. DROP
4. TRUNCATE
5. COMMENT
6. RENAME
Database changed
2. Create the table:
Table created.
3. View the table
structure: SQL>
Null? Type
EMPNO INT
ENAME CHAR(11)
POSITION VARCHAR
(8)
Table altered.
SQL> DESC
EMP;
EMPNO INT
ENAME CHAR(11)
POSITION VARCHAR(8)
Table altered.
SQL> DESC
EMP;
EMPNO INT
ENAME CHAR(11)
POSITION VARCHAR(8)
SALARY INT
Table altered.
Table altered.
Table altered
1. SELECT
2. INSERT
3. DELETE
4. UPDATE
1 row created.
(102,”KANNAN”,”PROFESSOR”,50000);
3. Display the records from employee.
EMPLOYEE;
1 row updated.
1 row deleted.
SQL> CREATE TABLE CUSTOMERS( ID INT NOT NULL, NAME VARCHAR (20)
NONULL, AGE INT NOT NULL UNIQUE, ADDRESS CHAR (25) , SALARY DECIMAL (18, 2),
CUSTOMERS
ID
NAME
AGE
ADDRESS
Empty
CUSTOMERS
ID NAME AGE ADDRESS
1 Ramesh 32 Ahmedabad
2 Khilan 25 Delhi
3 kaushik 23 Kota
4 Chaitali 25 Mumbai
7. Primary Key:
SQL>CREATE TABLE CUSTOMERS( ID INT NOT NULL, NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL UNIQUE, ADDRESS CHAR (25) , SALARY DECIMAL (18, 2),PRIMARY
KEY (ID) );
SQL>ALTER TABLE CUSTOMERS DROP PRIMARY KEY ;
RESULT:
The database was created using the various commands and constraints.
EX. NO :2 Database Querying – Foreign key constraints
and referential integrity.
AIM:
integrity.
ALGORITHM:
Creating a table for relating databases using constraints
PROGRAM:
Foreign Key constraint:
Foreign Key:
1
Referential integrity:
Table created.
RESULT:
The database was created for relating between databases using the foreign key and referential
constraints.
1
EX.No:3 Aggregate functions
AIM:
To create a database tables using aggregate functions.
ALGORITHM:
PROGRAM:
SQL> desc emp;
6 rows selected.
EMPNO NUMBER(4)
PH_NO NUMBER(8)
EMPNO PH_NO
3737 225301
4545 485565
6544 789663
7575 896652
6555 987777
1) Avg (Average):
SAL=34250
2) Min (Minimum):
3) Max (Maximum):
SUM=205500
4) Count:
COUNT-6
5)Where clause:
RESULT:
The employee database was created and aggregate functions were used.
EX.No:4
Database Querying – Simple queries, Nested queries, Sub
queries and Joins
AIM:
To create a database using Nested Queries, Sub Queries and different joins
ALGORITHM:
PROGRAM:
SQL> CREATE TABLE CUSTOMERS (ID INT NOT NULL, NAME VARCHAR (20) NOT
NULL,AGE INT NOT NULL, ADDRESS CHAR (25), SALARY DECIMAL (18, 2),
PRIMARY KEY (ID));
1. Sub Queries:
SQL> UPDATE CUSTOMERS SET SALARY = SALARY * 0.25 WHERE AGE IN (SELECTAGE FROM
CUSTOMERS_BKP WHERE AGE >= 27);
+ + + + + +
| ID | NAME | AGE | ADDRESS | SALARY |
+ + + + + +
| 1 | Ramesh | 35 | Ahmedabad | 125.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 2125.00 |
| 6 | Komal | 22 | MP | 4500.00 |
3. Joins:
INNER JOIN
LEFT JOIN
RIGHT JOIN:
FULL JOINS:
SELF JOINS:
RESULT:
The database was created for relating between databases using the joins and sub queries.
EX.No:5 DATABASE PROGRAMMING- VIEWS -NATURAL, EQUI AND
OUTER JOINS
AIM:
ALGORITHM:
PROGRAM:
NATURAL JOIN:
SQL>CREATE TABLE customer ( id INT AUTO_INCREMENT PRIMARY KEY, customer_name
VARCHAR( 55), account int, email VARCHAR(55));
Table Created
Table Created
Customer
id customer_name account email
1 Stephen 1030 stephen@javatpoint.com
2 Jenifer 2035 jenifer@javatpoint.com
3 Mathew 5564 mathew@javatpoint.com
4 Smith 4534 smith@javatpoint.com
5 David 7648 david@javatpoint.com
Balance
id accoun balance
t
1 1030 50000
2 2035 230000
3 5564 125000
4 4534 80000
5 7648 45000
EQUI JOIN:
id class city
93 Delhi
10 2 Delhi
12 2 Delhi
name id city
Hina 9 Delhi
Megha 9 Delhi
Gouri 9 Delhi
Hina 10 Delhi
Megha 10 Delhi
Gouri 10 Delhi
Hina 12 Delhi
Megha 12 Delhi
Gouri 12 Delhi
SQL>CREATE TABLE college ( id INTEGER, classTeacher TEXT NOT NULL, Strength TEXT
NOT NULL);insert some values INSERT INTO college VALUES (1, 'Alpha', '50'); INSERT
INTO college VALUES (2, 'Romeo', '60');INSERT INTO college Values (3, 'Charlie', '55');
Class Teacher
Id
Alpha 1
Romeo 2
Charlie 3
RESULT:
The database was created for relating between databases using the joins and sub queries.
DATABASE PROGRAMMING- PROCEDURES AND
EX.No:6
FUNCTIONS
AIM:
Algorithm:
Function:
SQL>delimiter $$
>Create function func1 (str varchar(20))
>return char(50)
>return CONCAT(‘WELCOME TO’, str)
>end $$
>delimiter $$
>select func1(‘DBMS LAB’);
>$$
Procedure:
SQL> declare
2 ave number(5,2);
3 tot number(3);
4 cursor c_mark is select*from student where mark1>=40 and
mark2>=40 and 5 mark3>=40 and mark4>=40 and mark5>=40;
6 begin
7 dbms_output.put_line('regno name mark1 mark2 mark3 mark4 mark5 total
8 average');
9 dbms_output.put_line(' ')
; 10 for student in c_mark
11 loop
12 tot:=student.mark1+student.mark2+student.mark3+student.mark4+student.mark5;
13 ave:=tot/5;
14 dbms_output.put_line(student.regno||rpad(student.name,15)
15 ||rpad(student.mark1,6)||rpad(student.mark2,6)||rpad(student.mark3,6)
16 ||rpad(student.mark4,6)||rpad(student.mark5,6)||rpad(tot,8)||rpad(ave,5));
17 end loop;
18 end;
19 /
regno name mark1 mark2 mark3 mark4 mark5 total average
101 priya 78 88 77 60 89 392 78.4
102 karthi 99 77 69 81 99 425 85
103 karthipriya 100 90 97 89 91 467 93.4
RESULT:
Thus the program for creation of procedure is executed successfull
EX.No:7
Execute complex transactions and realize DCL and TCL
commands
AIM:
To execute DCL and TCL Commands.
Algorithm:
Step 1: Start a program
Step 2: Enter the input
Step 3: Execute the TCL abd DCL commands.
Step 4: Stop the program
1.Write a query to end your current transaction and make permanent all
changes performed in the transaction.
SQL> commit;
Commit
complete.
Table created.
SQL> insert into goods values(&sno,&itemcode,'&itemname',&cost);
Enter value for sno:1
Enter value for itemcode: 1025
Enter value for itemname: dell moniters
Enter value for cost: 5000
old 1: insert into goods values(&sno,&itemcode,'&itemname',&cost) new 1: insert into goods
values(1,1025,'dell moniters',5000)
values(&sno,&itemcode,'&itemname',&cost);
Enter value for sno: 1
Enter value for itemcode: 1025
Enter value for itemname: moniter
Enter value for cost: 5000
old 1: insert into goods values(&sno,&itemcode,'&itemname',&cost)
new 1: insert into goods values(1,1025,'moniter',5000)
1 row created.
SQL> /
Enter value for sno: 2
Enter value for itemcode: 1026
Enter value for itemname: mouse
Enter value for cost: 250
old 1: insert into goods values(&sno,&itemcode,'&itemname',&cost)
new 1: insert into goods values(1026,1026,'mouse',250)
1 row created.
SQL> /
Enter value for sno: 3
Enter value for itemcode: 1027
Enter value for item name: RAM
Enter value for cost: 1500
old 1: insert into goods values(&sno,&itemcode,'&itemname',&cost)
new 1: insert into goods values(3,1027,'RAM',1500)
1 row created.
SQL> /
Enter value for sno: 4
Enter value for itemcode: 1028
Enter value for itemname: webcam
Enter value for cost: 350
old 1: insert into goods values(&sno,&itemcode,'&itemname',&cost)
new 1: insert into goods values(4,1028,'webcam',350)
1 row created.
SQL> /
Enter value for sno: 5
Enter value for itemcode: 1029
Enter value for itemname: pendrive
Enter value for cost: 500
old 1: insert into goods values(&sno,&itemcode,'&itemname',&cost)
new 1: insert into goods values(5,1029,'pendrive',500)
1 row created.
SQL> select *from goods;
SNO ITEMCODE ITEMNAME COST
SQL> commit;
Commit complete.
3.Write a query to add the record into the table “goods” and set the Savepoint S1, S2 and S3
and verify it.
9 rows selected.
Write a query to Rollback to Save point S2 and verify it.
SQL> rollback to save point s2;
Rollback complete.
DCL Commands:
Grant:
GRANT SELECT, UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER;
RESULT:
Thus the TCL and DCL commands in SQL is successfully executed.
EX.No:8 TRIGGERS
AIM:
Algorithm:
Step 1: Start a program by creating table
Step2: Enter the input
Step 3: The output will be displayed based on the queryStep 5: Stop the program
Program:
Delimiter $$
create trigger update_trigger before update on account for each row
begin
if new.sum=50 then set new.sum=100;
else if new. Sum>50 then set new.sum=200;
end if;
end$$
Output function:
delimiter $$
MySQL> update account set sum=50
$$ select * from account;
-> $$
OUTPUT:
+ + +
| sum | amount |
+ + +
| 100 | 20 |
| 100 | 30 |
| 100 | 40 |
+ + +
RESULT:
Thus the program for creation of triggers and functions is executed successfully
EX.No:9 VIEWS AND INDEX
AIM:
To Create views and index for database tables.
PROGRAM:
6 rows selected.
EMPNO NUMBER(4)
PH_NO NUMBER(8)
SQL> select *
fromemp;
EMPNO PH_NO
3737 225301
4545 485565
6544 789663
7575 896652
6555 987777
CREATE VIEW
View created from more than one table leading to ‘Read Only’ view.
PH_NO
Priya 225301
priya 485565
santh 789663
Karthi 896652
INDEX:
UNIQUE INDEX
Index created
ALTER AN INDEX
Index altered
DROP INDEX
Index Dropped
RESULT:
Thus, the
XML DATABASE AND XML SCHEMA database
views
and
indexes were successfully executed.
EX.No:10
AIM:
To create an xml database and validate it using xml schema.
ALGORITHM:
XML file (on the File menu, point to New, and then click File).
3. Add the following data to the XML document to represent a product in a catalog:
<Product ProductID="123">
<ProductName>Rugby jersey
</ProductName>
</Product>
4. Save the file as Product.xml in a folder that you will be able to readily access later.
1. In Visual Studio 2005 or in Visual Studio .NET, point to New on the File menu, and
then click File.
3. Add the following DTD declarations to the file to describe the grammar of the XML
document: XML
<!ELEMENT Product (ProductName)>
<!ATTLIST Product ProductID CDATA #REQUIRED>
<!ELEMENT ProductName (#PCDATA)>
4. Save the file as Product.dtd in the same folder as your XML document.
5. Reopen Product.xml in Visual Studio 2005.
3. Add the following XDR schema definitions to the file to describe the grammar of the XML document:
<?xml version="1.0"?>
<Schema name="ProductSchema"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-
com:datatypes">
4. Save the file as Product.xdr in the same folder as your XML document.
5. Reopen the original Product.xml, and then link it to the XDR schema, as follows:
6
<ProductName>Rugby jersey</ProductName>
</Product>
6. Save the modified XML document as ProductWithXDR.xm
1. In Visual Studio .NET, point to New on the File menu, and then click File.
2. Select the Text File type, and then click Open.
3. Add the following XSD schema definition to the file to describe the grammar of the XML document:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Product">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ProductName" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="ProductID" use="required" type="xsd:int"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
4. Save the file as Product.xsd in the same folder as your XML document.
5. Reopen the original Product.xml, and then link it to the XSD schema, as follows:
<?xml version="1.0" encoding="utf-8" ?>
<Product ProductID="123"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:noNamespaceSchemaLocation="Product.xsd">
<ProductName>Rugby jersey</ProductName>
</Product>
6. Save the modified XML document as ProductWithXSD.xml.
6
Use namespaces in the XSD schema
1. In Visual Studio 2005 or in Visual Studio .NET, open ProductWithXSD.xml. Declare a default
namespace, urn:MyNamespace, in the document. Modify the XSD linkage to specify the XSD
schema to validate content in this namespace, as follows:
<?xml version="1.0" encoding="utf-8"?>
<Product ProductID="123"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns="urn:MyNamespace"
xsi:schemaLocation="urn:MyNamespace Product.xsd">
<ProductName>Rugby jersey</ProductName>
</Product>
2. Save ProductWithXSD.xml.
3. Open Product.xsd, click the XML tab, and then modify the xsd:schema start tag as follows, so
that the schema applies to the namespace urn:MyNamespace:
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:MyNamespace"
elementFormDefault="qualified">
4. Save Product.xsd.
5. Run the application to validate the XML document by using the XSD schema.
0utput:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Product">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ProductName" type="xsd:string"/>
6
</xsd:sequence>
<xsd:attribute name="ProductID" use="required" type="xsd:int"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
RESULT:
The xml database was successfully created by display the web page of validate xml schema
7
Execute complex transactions and realize DCL and TCL commands.
EX.No:11
AIM:
To Create document, column and graph based data using NOSQL database tools
PROGRAM:
Create Database:
>use javatpointdb
Swithched to db javatpointdb
>db
Insert a document:
>db.movie.insert({"name":"javatpoint"})
db.javatpoint.insert(
{
course:
"java",
details: {
duration: "6 months",
Trainer: "Sonoo
jaiswal"
},
Batch: [ { size: "Small", qty: 15 }, { size: "Medium", qty: 25 } ],
8
category: "Programming language"
}
)
WriteResult({ "nInserted": 1})
Drop Database:
> db.dropDatabase()
1} Create collection :
>db.SSSIT.insert({"name" : "seomount"})
>show
collections SSSIT
db.collection_name.find()
Neo4j CQL
Create
nodes:
Open the localhost on the browser: http://localhost:7474/browser/ and use the following code:
CREATE (single);
8
MATCH (n) RETURN (n)
8
CREATE (primary_node), ( secondary_node);
8
RESULT:
Thus the NoSQL database tool successfully designed and executed.
8
EX.NO.12 DATABASE GUI APLLICATION – PAYROLL MANAGEMENT
AIM:
SAMPLE CODE:
Dim db As
Database Dim rs As Recordset
Private Sub
cmdADD_Click()
rs.AddNew DtPicker
DOJ.Enabled = True
txtEmpID.Enabled = True
txtFirstName.Enabled = True
txtLastName.Enabled = True
txtAddress.Enabled = True
txtDOJ.Enabled = True
txtSalary.Enabled = True
txtEmpID.SetFocus
txtEmpID.Text = ""
txtFirstName.Text = ""
txtLastName.Text = ""
txtAddress.Text = ""
txtDOJ.Text=Date
txtSalary.Text =""
txtHRA.Text = ""
txtDA.Text = ""
txtTA.Text = ""
txtPF.Text= ""
txtGrossPay.Text = ""
txtNetPay.Text = ""
cmdEdit.Enabled=False
cmdSubmit.Enabled = False
cmdCalculate.Enabled=
Private Sub
cmdCalculate_Click()If
project"txtSalary.SetFocus Else
txtHRA.Text = 0.15 *
* Val(txtSalary.Text) txtTA.Text =
= 0.05 * Val(txtSalary.Text)
cmdSubmit.Enabled =
True cmdADD.Enabled =
False
Else
Cancel=False
rs.Delete
Project" ClearALL
Else
Cancel=True
End If
'rs.MoveNex
t End If
End Sub
txtFirstName.Enabled = True
txtLastName.Enabled = True
txtAddress.Enabled = True
txtDOJ.Enabled = True
txtSalary.Enabled= True
rs("FIRSTNAME")
txtFirstName.Textrs("LASTNAME")
txtLastName.Text rs("ADDRESS")
txtAddress.Text
rs("DATEOFJOINING") = txtDOJ.Text
rs("SALARY") =txtSalary.Text
rs("HRA") = txtHRA.Text
rs("DA") = txtDA.Text
rs("TA") = txtTA.Text
Cancel=False
End
Else
Cancel=True
End If
End Sub
Private Sub
cmdFirst_Cli
ck()
rs.MoveFirst
cmdPrev.Ena
bled = False
cmdFirst.En
abled = False
cmdNext.Enabled = True
cmdLast.Enabled = True
End Sub
Private Sub cmdLast_Click()
rs.MoveLast cmdFirst.Enabled = True
cmdPrev.Enabled = True
cmdNext.Enabled = False
cmdLast.Enabled = False
cmdEdit.Enabled = True
GetData
End Sub
cmdEdit.Enabled = True
cmdFirst.Enabled = True
cmdPrev.Enabled=True
rs.MoveNext
If rs.EOF = True
Then
cmdNext.Enabled=False
e cmdLast.Enabled = False
MsgBox "LAST RECORD", vbInformation, "Employees Project" rs.MoveLast
Else GetData
End If
End Sub
Private Sub cmdPrev_Click() cmdEdit.Enabled = True
cmdFirst.Enabled = True
cmdNext.Enabled = True
cmdLast.Enabled = True
rs.MovePrevious
If rs.BOF = True
Then
cmdFirst.Enabled = False
cmdPrev.Enabled = False
MsgBox "FIRST RECORD", vbInformation, "Employees Project"
rs.MoveFirs
t Else
GetData
End If
GetDat
a End
Sub
Private Sub
cmdReport_Click()
DataReport1.Show
End Sub
Private Sub
cmdSubmit_Click() On Error
GoTo errhandler2
rs("EMPID")=txtEmpID.Text
rs("FIRSTNAME") = txtFirstName.Text
rs("LASTNAME") = txtLastName.Text
rs("ADDRESS") = txtAddress.Text
rs("DATEOFJOINING") = txtDOJ.Text
rs("SALARY") = txtSalary.Text
rs("HRA") = txtHRA.Text
rs("DA") = txtDA.Text
rs("TA") = txtTA.Text
rs("PF") = txtPF.Text
rs("GROSSPAY") =txtGrossPay.Text
rs("NETPAY") =txtNetpay.Text
Private Sub
txtAddress_Change()
cmdSubmit.Enabled = True
End Sub
Private Sub
txtDOJ_Change()
cmdSubmit.Enabled =
[Private Sub
txtEmpID_Change()
cmdSubmit.Enabled = True
End Sub
KeyAscii = 0
Private Sub
txtFirstName_Change()
cmdSubmit.Enabled = True
End Sub
Private Sub
txtLastName_Change()
cmdSubmit.Enabled = True
End Sub
Private Sub
txtSalary_Change() If
If rs.RecordCount <> 0
Then
txtEmpID.Text = rs("EMPID")
txtFirstName.Text = rs("FIRSTNAME")
txtLastName.Text = rs("LASTNAME")
txtAddress.Text = rs("ADDRESS")
txtDOJ.Text = rs("DATEOFJOINING")
txtSalary.Text = rs("SALARY")
txtHRA.Text = rs("HRA")
txtDA.Text = rs("DA")
txtTA.Text = rs("TA")
txtPF.Text=rs("PF")
txtGrossPay.Text = rs("GROSSPAY")
txtNetPay.Text = rs("NETPAY")
txtEmpID.Enabled = False
txtFirstName.Enabled = False
txtLastName.Enabled = False
txtAddress.Enabled = False
txtDOJ.Enabled = False
txtSalary.Enabled = False
txtHRA.Enabled = False
txtDA.Enabled= False
txtTA.Enabled = False
txtPF.Enabled = False
txtGrossPay.Enabled =False
txtNetPay.Enabled = False
cmdSubmit.Enabled = False
cmdCalculate.Enabled=Fals
DtPickerDOJ.Enabled=False
Else
txtEmpID.Enabled = False
txtFirstName.Enabled = False
txtLastName.Enabled = False
txtAddress.Enabled = False
txtDOJ.Enabled = False
txtSalary.Enabled = False
txtHRA.Enabled = False
txtDA.Enabled = False txtTA.Enabled = False txtPF.Enabled = False
txtGrossPay.Enabled = False
txtNetPay.Enabled = False c
mdSubmit.Enabled = False
cmdCalculate.Enabled = False End If
End Sub
PrivateSubtxtSalary_KeyPress(KeyAsciiAs
Integer)
If (KeyAscii < 48 Or KeyAscii > 57) Then
KeyAscii = 0
cmdADD.Enabled = True
cmdCalculate.Enabled = False
cmdSubmit.Enabled = False
DATABASE IN MS ACCESS:
1
0
1
0
FORMS WHILE EXECUTION:
1
0
1
0
1
0
1
0
1
0
1
0
1
0
RESULT:
Thus the Student Personal Information System is successfully designed using PHPwith mysql as backend.
CASE STUDY E-Mart
GroceryShop
EX.NO:13
AIM:
To create a database for E-mart Grocery shop and apply all sql properties.
SAMPLE CODE:
Cross join:
select *
from grocery_visit
cross join dept_store_visit
where grocery_visit.amount_spent >
and dept_store_visit.amount_spent > 15;
15
RESULT:
Thus the E-mart Grocery Shop is successfully designed.
1..What is DBMS and what is its utility? Explain RDBMS with examples.
2.What is a Database?
3.Mention the issues with traditional file-based systems that make DBMS a better
choice?
7.Are NULL values in a database the same as that of blank space or zero?
10.What is meant by an entity-relationship (E-R) model? Explain the terms Entity, Entity
Type, and Entity Set in DBMS.
13.Explain the difference between the DELETE and TRUNCATE command in a DBMS.
14.What is a lock. Explain the major difference between a shared lock and an exclusive
lock during a transaction in a database.