DBMS: Executing Queries over Tables in My SQL
We'll execute queries on the table created in previous post....
1. Prepare a query to display all records, and 'Name' should be in ascending order.
i) To make a query, go to 'Create' Tab, under 'Other' Group, click on 'Query Design'.
ii) A dialog box will appear. Here we have to select all the tables to be included in our query i.e. 'studentinfo' table. Click on 'Add' button, then on 'Close' button.
iii) Now Save the query by right clicking on the 'Query1' tab and selecting 'Save'.
iv) Now switch to 'SQL View' by right clicking on the 'Query1' tab and selecting 'SQL View'.
v) In the SQL View, type-
Select * from studentinfo order by Name asc;
vi) To view the resultant records of the query, switch to 'Datasheet View'.
vii) 'Save' the table.
2. Prepare a query named "senior" to display records including fields name, class, section, rollno, status, photo, and value of 'status' should be "senior".
i) To make a query, go to 'Create' Tab, under 'Other' Group, click on 'Query Design'.
ii) A dialog box will appear. Here we have to select all the tables to be included in our query i.e. 'studentinfo' table. Click on 'Add' button, then on 'Close' button.
iii) Now switch to 'SQL View' by right clicking on the 'Query2' tab and selecting 'SQL View'.
iv) In the SQL View, type-
Select Name, Class, Section, Rollno, Status, Photo from studentinfo where Status="Senior";
v) Now Save the query with the name "senior" by right clicking on the 'Query2' tab and typing new name i.e.'senior'. Click on 'OK'.
vi) To view the resultant records of the query, switch to 'Datasheet View'.
3. Prepare a form of above query "senior".
i) Firstly select the query or table whose form we want to create i.e. 'senior' query.
ii) Go to 'Create' tab, under 'Forms' Group, click on 'Form' button.
iii) A form will automatically be generated containing the details of the query 'senior'.
iv) 'Save' the form.
4. Prepare a report of all the fields of above table.
i) Firstly select the query or table whose report we want to create i.e. 'studentinfo' table.
ii) Go to 'Create' tab, under 'Reports' Group, click on 'Report' button.
iii) A report will automatically be generated containing the details of the table 'studentinfo'.
iv) 'Save' the report.
Please Visit: www.lovebookessence.blogspot.com
1. Prepare a query to display all records, and 'Name' should be in ascending order.
i) To make a query, go to 'Create' Tab, under 'Other' Group, click on 'Query Design'.
ii) A dialog box will appear. Here we have to select all the tables to be included in our query i.e. 'studentinfo' table. Click on 'Add' button, then on 'Close' button.
iii) Now Save the query by right clicking on the 'Query1' tab and selecting 'Save'.
iv) Now switch to 'SQL View' by right clicking on the 'Query1' tab and selecting 'SQL View'.
v) In the SQL View, type-
Select * from studentinfo order by Name asc;
vi) To view the resultant records of the query, switch to 'Datasheet View'.
vii) 'Save' the table.
2. Prepare a query named "senior" to display records including fields name, class, section, rollno, status, photo, and value of 'status' should be "senior".
i) To make a query, go to 'Create' Tab, under 'Other' Group, click on 'Query Design'.
ii) A dialog box will appear. Here we have to select all the tables to be included in our query i.e. 'studentinfo' table. Click on 'Add' button, then on 'Close' button.
iii) Now switch to 'SQL View' by right clicking on the 'Query2' tab and selecting 'SQL View'.
iv) In the SQL View, type-
Select Name, Class, Section, Rollno, Status, Photo from studentinfo where Status="Senior";
v) Now Save the query with the name "senior" by right clicking on the 'Query2' tab and typing new name i.e.'senior'. Click on 'OK'.
vi) To view the resultant records of the query, switch to 'Datasheet View'.
3. Prepare a form of above query "senior".
i) Firstly select the query or table whose form we want to create i.e. 'senior' query.
ii) Go to 'Create' tab, under 'Forms' Group, click on 'Form' button.
iii) A form will automatically be generated containing the details of the query 'senior'.
iv) 'Save' the form.
4. Prepare a report of all the fields of above table.
i) Firstly select the query or table whose report we want to create i.e. 'studentinfo' table.
ii) Go to 'Create' tab, under 'Reports' Group, click on 'Report' button.
iii) A report will automatically be generated containing the details of the table 'studentinfo'.
iv) 'Save' the report.
Please Visit: www.lovebookessence.blogspot.com
Comments
Post a Comment