Saturday, December 12, 2020

#597 Consider the relations Student sid name age gender

Consider the relations Student sid name age gender - Computer Science

ChemistryExplain daily providing Q&A content “#597 Consider the relations Student sid name age gender" in Computer science, Ba computer science, Berkeley computer science, a Computer science associate degree jobs

ChemistryExplain “#597 Consider the relations Student sid name age gender" in Computer science, Ba computer science, Berkeley computer science, Computer science associate degree jobs
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

 ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

For More Chegg Questions

Join Our Telegram Channel for Covers All Update by ChemistryExplain:- Click Now

Free Chegg Question

Consider the relations Student(sid, name, age, gender, address, fee, sem_Id) and Semester (sem_Id, date). Write relational algebra expressions for the following:

  1. Get all the students from the Student
  2. Select all the female students from the Student
  3. Find all students whose age is greater than 20
  4. Count all the students less than 20 years
  5. Find all students whose name starts with ‘A’
  6. Find the average age of the students.
  7. Find the total sum of the fee.
  8. Find the maximum age of students.
  9. Find all the details of students whose age is maximum.
  10. Find all students whose age lies between 20 and 25.
  11. Find the name of the student who lives in Liaquat-e-bad.
  12. Display the list of all the students along with semester details.
  13. Find the youngest student in the class.
  14. Retrieve the details of the semester in which there are more than two students.
  15. Retrieve the details of all the students along with the semester. If a student is not enrolled in a semester, the details of the students should be displayed.
  16. Retrieve the details of all the semesters along with enrolled students. If a semester has no enrolled students, the details of the semester should be displayed.
  17. Retrieve the details of students with semester irrespective of if the students are enrolled in a semester or if a semester has any students or not.
  18. Find the names of students who are younger than ‘Saleem’
  19. Find the students who are neighbors of ‘Kaleem’.
  20. Find the names of all students who are older than the average age of students.
  21. Find the details of all students who are in semester 1.

Free Chegg AnswerFor More Chemistry Notes and Helpful Content Subscribe Our YouTube Chanel - Chemistry Explain  

Free Chegg Answer

At 1st you must know in algebra relationship we have:-

Projection (π)
Projection is used to project required column data from a relation.

Selection (σ)
Selection is used to select the required tuples of the relations.

Cross Product (X)

Cross product between two relations let's say A and B, so cross product between A X B will result in all the attributes of A followed by each attribute of B. Each record of A will pair with every record of B.

Natural Join (⋈)

Natural join is a binary operator. Natural join between two or more relations will result set of all combinations of tuples where they have equal common attributes.

Now let's move to answers of the questions:-

Ans.1> π name(Student).

Explanation:- Here all student names will be projected.

Ans.2> π name(σ gender= female ( Student))

Explanation:- Here only female student names will be shown.

Ans.3> π name(σ age>20(Student))

Explanation:- Here all student names will be shown, whose age is greater than 20.

Ans.4>π name( σ age<20(name G count(age)(Student)))

explanation:- Here number of name count will be displayed.

Ans.5>  σ age(age G avg(age)(student)).

Explanation:- Here average age will be displayed.

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home