Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In SQL server I have two tables social_media_profile and tweets_info. The social

ID: 3708272 • Letter: I

Question

In SQL server I have two tables social_media_profile and tweets_info. The social_media_profile table has one column called SmID and it is the primary key. The tweets_info table has links, timestamp, and SmID columns, SmID is the foreign key. Using T-SQL, I need help with storing the links of each tweet or post, along with the time stamp. The link should be stored with the proper user id, in this case, the proper SmID. Each tweet/post and timestamp should have its own row. How do I do this?

This screenshot should provide some visual view of the type of data I am working with. Each tweet and timestamp should be matched to the proper profile. The values cannot be hardcoded, they should be stored everytime a user makes a tweet or post. So I think it would be neccessary to use parameters?

Timestamp Your Twitter profile List of tweets/retweets 2102171142 07 i https://twitter.com/dummytweets/stat/3443503505030403024 2/10/2017 11:47:07 https://twitter com/dummyuser2000 https:/twitter.com/dummytweets/stat/3443503505030403024

Explanation / Answer

T-SQL is nothing but extension of SQL language providing certain benefits in Transactions.

*********************SQL QUERY**************************************

Select SmID from as 'SocialMediaID' from social_media_profile where SmID = 'dummyuser2000';

Begin TRANSACTION

INSERT INTO tweets_info (SmID, link, timestamp) values

SocialMediaID, 'https://twitter.com/dummyuser2000/tweets/1', '2/10/2017 11:47: 07' UNION ALL

SocialMediaID, 'https://twitter.com/dummyuser2000/tweets/2', '2/10/2017 11:47: 07'

COMMIT TRANSACTION

The union all operator ensures data entry into new rows everytime.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote