Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3358762
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:47:28+00:00 2026-05-18T02:47:28+00:00

I am new to SQL and been given a task. Following are the details:

  • 0

I am new to SQL and been given a task. Following are the details:

What I have:

  1. A C# desktop application for User login and view user status (only two options: user logs in and check status of all users that are dummy created)

  2. A table named USER containing

    • id
    • username
    • datecreated
  3. A table named LOGINSTAT containing

    • id
    • username
    • Logtime
    • logDate

What I have to implement

I have to save time and date when ever user logs in in LOGINSTAT table using SQL.

My question

My question is how can I implement that. I can do the coding part but I am interested in getting some good advice to implement it. I think of it as a formal way as I know to do it:

when user logs in insert values into the login table giving all the required values.

BUT

I think that might be a bit odd. Some of my friends said you may be able to implement it by use of foreign key and primary keys, but the problem lies that the user may log in many time in a day. How to keep track of login time and date in that case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:47:29+00:00Added an answer on May 18, 2026 at 2:47 am

    You don’t need username in your LOGINSTAT table.

    You’ll probably want the LOGINSTAT to include:

    • id
    • u_id
    • loginDateTime

    id is the unique ID of every login
    u_id is a foreign key from the id in users that matches your log event to a user
    loginDateTime is a datetime that will give you both your log date and log time in one column

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm very new to sql but have been passed a job in which
I am new to SQL Server, and I have been tasked with setting permissions
I am totally new to SQL . I have a simple select query similar
We've just been given the following code as a solution for a complicated search
I have an application I’m writing in access with a SQL server backend. One
I'm loading a SQL Server 2000 database into my new SQL Server 2005 instance
I'm looking mainly at things like new SQL syntax, new kinds of locking, new
I'm new to SQL Server Reporting Services, and was wondering the best way to
I'm terribly new to SQL, and cannot seem to get the desired information out,
Im very new to SQL but need to write a query to do the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.