qs - ahmad alhayek

qs

 Flag

Do the following steps:

  1. Create a user named the first name student and grant him full permission dba.
  2. Create a table in the first user named person It contains the following columns
    1. PersonID number(10) primary key
    2. FirstName varchar(50) not null
    3. LastName varchar(50)
    4. City varchar(50)
    5. Address varchar(50)
  3. Add a new column named FatherName varchar(50).
  4. Create a role named view it contains full permission dba.
  5. Create another user called the second name student and grant him role view.
  6. Create a table in the first user named company It contains the following columns
    1. companyName varchar(50)
    2. City varchar(50)
    3. Address varchar(50)

Expert Answerinformation icon

  • Anonymous's Avatar
    create user first_user for login MyLogin

    To grant permission to a user using T-SQL, you first select the database using the use statement. You then assign the permission to the user using the grant statement. Here is the syntax-

    use <database-name>
    grant <permission-name> on <object-name> to <username\principle>

    An example for it would be-

    USE EDU_TSQL
    GO
    Grant select on Course to Student.

    You can then use following syntax for creating the table

    CREATE TABLE Student(
        PersonID int,
        LastName varchar(50),
        FirstName varchar(50),
        Address varchar(50),
        City varchar(50)
    );

    Adding Father Name into the existing table

    ALTER TABLE Student
    ADD FatherName varchar(50)

    Comment 

ليست هناك تعليقات:

إرسال تعليق

ahmad alhayek تصميم ahmad alhayek جميع الحقوق محفوظة 2016

صور المظاهر بواسطة sndr. يتم التشغيل بواسطة Blogger.