Salary: Holds decimal values of salary for each employee. LastName: Holds varchar values for the last name of the employee.įirstName: Holds varchar values for the first name of the employee.Įmail: Holds varchar values for the email ID of the employee.ĭeptNum: Holds varchar for department ID that an employee belongs to. Given below is a sample table created in MYSQL.ĮmpNum: Holds integer values for the employee number. If not mentioned, or if the condition is not set correctly then either the whole table or non-required rows will be a part of the view. The WHERE clause is, however, significant. WHERE is also a keyword, but an optional one. Then comes the WHERE condition, that restricts or filters the number of target rows on which the CREATE VIEW action has to be applied.Next comes the name of the table on which the view has to be performed.A view can have all the columns of the underlying table or only a selected few. Then, select the columns from the table.It should be unique just like the names of tables and columns. We can use this while we are working on an existing view. This is a mandatory keyword and cannot be omitted. The syntax starts with the keyword “CREATE VIEW”, thereby informing the MySQL Server about the type of activity to be performed.Syntax: CREATE VIEW view_name AS SELECT col1, col2. Create View Using GROUP BY and ORDER BY.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |