1. Aman, a freelance web site developer, has been assigned a task to design few web pages for a book shop. Help Aman in deciding out of static web page and dynamic web page, what kind of web pages should be designed by clearly differentiating between static and dynamic web pages on at least two points.
Ans:
| Static Web Page |
Dynamic Web Page |
| Content of this type of webpage cannot be changed at run time.
|
Content of this type of webpage can be changed at run time.
|
| No interaction with server’s database is possible in case of static web pages.
|
Interaction with server’s database is possible in case of dynamic web pages.
|
OR
Priyanka, a beginner in IT field has just started learning web technologies. Help her in understanding the difference between website and web pages with the help of a suitable general example of each.
Ans:
| Website |
Web Page |
|
A website is a collection of different web pages containing information on a particular topic.
|
A web page is an individual page of a big website usually containing more specific information.
|
|
If we compare a website with a book, then a website is like the complete book.
|
A web page can be compared with a single page of that book.
|
2. (i) am a small text file
created on a user’s computer
contain small pieces of data - like a username, password and user’s browsing history as well as preferences
may help to improve user’s web browsing experience.
Who am I?
Ans: Cookies
(ii) Name any two popular web browsers.
Ans: Mozilla Firefox, Google Chrome, Safari, Microsoft Edge
3. Predict the output of the following queries:
i. Select power(5,3);
Ans: 125
ii. Select mod(5,3);
Ans: 2
OR
Briefly explain the purpose of the following SQL functions:
i. power()
Ans: It returns the value of a number raised to the power of another number.
For example: Select power(5,3);
Output: 125
ii. mod()
Ans: It returns the remainder of a number divided by another number.
For example: Select mod(5,3);
Output: 2
4. Navya has just created a website for her company and now need to host it. Briefly discuss the role of a web server in hosting a website.
Ans: Role of web server in hosting a website:
A web server is the main centralized computer system that hosts and runs the websites. It has a computer program that distributes web pages as they are requisitioned. The basic role of the web server is to store, process and deliver the web pages to the users as and when required.
5. Help Reshma in predicting the output of the following queries:
i) select round(8.72,3);
Ans: 8.720
ii) select round(9.8);
Ans: 10
6. Aryan, a database administrator, has grouped records of a table with the help of group by clause.
He needs to further filter groups of records generated through group by clause.
Suggest suitable clause for it and properly explain its usage with the help of an example.
Ans: Having clause is used to further filter those groups of records which will be generated through group by clause.
For example:
Select max(marks) from student group by classes having classes in (10,12);
Above given query will arrange records in groups according to the classes. Further filtering on these groups will happen through having clause, which will finally display the highest marks from classes 10 and 12.
7. Mr. Som, a HR Manager in a multinational company “Star-X world” has created the following table to store the records of employees:
Table: Emp
| Eid |
EName |
Department |
DOB |
DOJ |
| Star1 |
Ivan |
Sales |
1994-08-28 |
2020-02-14 |
| Star2 |
Melinda |
IT |
1997-10-15 |
2021-11-19 |
| Star3 |
Raj |
Accounts |
1998-10-02 |
2019-04-02 |
| Star4 |
Michael |
Sales |
2000-02-17 |
2020-05-01 |
| Star5 |
Sajal |
IT |
2001-12-05 |
2018-06-13 |
| Star6 |
John |
Accounts |
1995-01-03 |
2019-07-15 |
| Star7 |
Julia |
Sales |
1985-11-13 |
2020-08-19 |
He has written following queries:
i) select max(year(DOB)) from emp;
ii) select ENAME from emp where month(DOJ)=11;
Predict the output.
Ans:
(i) 2001
(ii) Melinda
OR
Based on the table given above, help Mr. Som writing queries for the following task:
i) To display the name of eldest employee and his/her date of birth.
Ans: SELECT ENAME, min(year(DOB)) from emp;
ii) To display the name of those employees whose joining month is May.