Answer to Question #159499 in Databases | SQL | Oracle | MS Access for Arslan habib

Question #159499

a)   Create a data sheet in MS Access which includes Employee ID, Employee Name, Father Name, Gender (Male, Female), Age, Date of Joining (dd-mm-yyyy), Address, Cell number (0300-0000000) and City (Karachi, Islamabad, Lahore).

b)   Also create its Form and add at least 2 record through the form and create the following queries:

·      List only those employees who belong to the city Karachi.

·      Show only the female employee in the employee table

There should be at least 12 to 15 record in the table.

Please reply as fast as possible


1
Expert's answer
2021-02-01T08:01:51-0500

You can use design view or query to create table.

I showed you to create a table using query and then use design view to update constraint.

Go to Create -> Query design -> right click and select SQL View

Execute the following query to create the table

CREATE TABLE Employee(
             EmployeeID INT PRIMARY KEY
             , EmployeeName VARCHAR(100)
             , FatherName VARCHAR(100)
            , Gender VARCHAR(10)
              , Age INT
            , DateOfJoining DATE    
              , Address VARCHAR(100)
             , CellNumber VARCHAR(20)
             , City VARCHAR(100)
)

Visual Basic Code:

Option Compare Database



Private Sub btnSubmit_Click()

    Dim strSQL As String

   

    strSQL = "INSERT INTO EMPLOYEE (EmployeeID, EmployeeName, FatherName, Gender, Age, DateOfJoining, Address, CellNumber, City ) VALUES (" & txtEmployeeID & ",""" & txtEmployeeName & """,""" & txtFatherName & """,""" & txtGender & """," & txtAge & ",""" & txtDOJ & """,""" & txtAddress & """,""" & txtCell & """,""" & txtCity & """)"

    CurrentDb.Execute strSQL



End Sub




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS