Create a view in the database

Source: Internet
Author: User

View : Create a virtual table between the linked tables!

Step: Open the Database ' selected database ', right click ' View ', select ' New View '. Then add

' selected database ' has an associated ' table ', select the View to display the ' columns ', then close, save the new view and create the complete!

--drop View Xueshengfenshu--deleting views

--alter View XKF-- Modifying a view is removing overrides!

only used in front Top number after before you can use the Order by . Aggregate functions cannot be used in views

Create View Xueshengfenshu

As

Select Student.sno,sname,ssex,sbirthday,class,score. Cno,degree from Student

Join score on Student.sno=score. Sno- This is the complete CREATE VIEW statement!

Select *from Xueshengfenshu

--students. Course, score three-table view!

CREATE VIEW XKF

As

Select Student.sno,sname,ssex,sbirthday,class,score. Cno,degree,course. Cname from Student

Join score on Student.sno=score. Sno

Join course on course. Cno=score. Cno

Select *from XKF

Create a view in the database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.