Professional Documents
Culture Documents
QUERIES
MS Access - Query
• A query is a request for data results and action on data.
• You can use a query to answer a simple question, perform
calculations, combine data from different tables, or even add,
change, or delete table data.
• As tables grow in size they can have hundreds of thousands of
records, which makes it impossible for the user to pick out specific
records from that table.
• With a query you can apply a filter to the table"s data; so that you
only get the information that you want.
• In a standard Relational Database Management System (RDBMS),
queries are implemented using the commands built within the
Structured Query Language (SQL). Examples of RDBMS software
are MS-Access, MySQL, Oracle, Microsoft SQL Server.
MS Access - Query
The SQL standard has sublanguages such as:
NINJA TIP: Don’t try to write more than one command on the SQL query page of MS Access.
Write one command per query object.
Drop table (DDL)
• Create table IT;
• Drop table IT;
Insert Into (DML)
• Insert into Teacher (TeacherID, TName, Taddress, Tphone) values(1, "Ms
Pooja", "Rohini", "9910350987");
• Insert into Teacher (TeacherID, TName, Taddress, Tphone) values(2, “Ms
Manvi”, “Tilak Nagar", "9999350987");
• Insert into Teacher (TeacherID, TName, Taddress, Tphone) values(3, "Ms
Tanisha", "Rohini", "8810350987");
• Insert into Teacher (TeacherID, TName, Taddress, Tphone) values(4, "Mr
Singh", "Subhash Nagar", "7778350987");
• Insert into Teacher (TeacherID, TName, Taddress, Tphone) values(5, "Mr
Jayakar", "Janakpuri", "7292036505");
NINJA TIP: Whenever you are copy-pasting the commands from any other source: Webpage/Word/ any other
place. First, paste the content into notepad and then again copy and paste it into the required command
editor/place.
Select Command (Query): DML / Query
• Select TeacherID from Teacher;
• Select TeacherID, TName, Taddress, Tphone from
Teacher;
• Select * from Teacher;
Update Command (DML)