Nokia 9 passes through the FCC with dual rear cameras and Snapdragon 835

We might still see a Christmas miracle, but apart from that, it’s looking more likely that the unannounced Nokia 9 will not debut before the year is out. Even so, it appears that the smartphone recently paid a visit to the FCC, with the phone appearing similar to the Nokia 8 in a few areas.

Starting with the display, the Nokia 9 features a 5.5-inch QHD OLED display, which is a bit larger than the Nokia 8’s 5.3-inch LCD display and delivers deeper blacks and punchier, albeit slightly unrealistic, colors. Much like the Nokia 8, the Nokia 9 also sports dual rear cameras — the former features dual 13 MP cameras, while the latter opts for a 12 MP and 13 MP sensor.

The rear cameras are not that different, though the story changes with the front camera. Whereas the Nokia 8 features a 13 MP selfie camera, the Nokia 9 makes do with a 5 MP sensor. I’m not sure why this change is so drastic, and even though megapixels aren’t everything, it’s hard to ignore the drop in image resolution.

Editor’s Pick

To wrap up the differences, the Nokia 9 swaps the Nokia 8’s 3,090 mAh battery for a larger 3,250 mAh power pack.

Everything else about the Nokia 9 is pretty much the same when compared to the Nokia 8. That means you’ll still find Qualcomm’s Snapdragon 835 chipset and 128 GB of internal storage, with a microSD card slot available for additional space.

Some people might be upset about Nokia’s choice to go with the Snapdragon 835 for the Nokia 9, particularly since Qualcomm announced the newer, more capable Snapdragon 845 chipset. At the same time, it’s not like the Snapdragon 845 was announced when Nokia started work on the Nokia 9.

There are still some unanswered questions around the Nokia 9, such as when Nokia will unveil the phone, when it will be available, and how much it will go for. At this point, the earliest we could see the Nokia 9 is during CES 2018, though MWC 2018 might be slightly more viable.

Here’s How Trump Is Pitting Local Police Against the FBI

Malcom Nance explains how Trump is using the ‘authoritarian playbook.’

SNBC contributor Malcom Nance reportedly scared the “bejesus” out of viewers on Sunday when he pointed out that President Donald Trump was following the authoritarian playbook by pitting police against federal law enforcement.

“Do I have to be the one that comes out and tells the American public, the last time we had a crisis of this magnitude was the Civil War,” he explained. “The Civil War, they at least used the precepts of the Constitution to make a legal separation from the United States.”

“Other than putting troops in your house, many of these things are happening,” Nance continued. “If he takes away the fundamental ability for us to police ourselves, to police the president of the United States, then he has done the ultimate in obstruction of justice. He is dismantling the Constitution and it cannot stand! We cannot allow it to stand.”

He added: “Everybody who is watching this who is in government right now who would think this is good, then you’re just doing a [Communist Party propaganda agency] politburo. Okay? We don’t need Saddam Hussein’s People’s Council here. What we nee to do is defend this nation’s democracy.”

 

MSNBC viewers immediately reacted to Nance’s words with alarm. One viewer noted that Nance had scared the “bejesus” out of her.

Watch the clip below.

 

 

Related Stories

  • Trump Is Really Trying to Set the World on Fire
  • Unbelievable Censorship: Trump Bans CDC from Using These 7 Words
  • Why Even the Idea That Neocon Senator Tom Cotton Might Run Trump’s CIA Is Scary

Netgear Orbi RBK50

Fiddling around with technology that doesn’t work makes me very nervous. On the plus side I am then mighty pleased when I finally get everything working. And so I am happy to report that after fiddling I managed to dramatically improve the WiFi reception in my home by installing a Netgear Orbi RBK50.

For the last few years I have been using a Linksys EA7500 WiFi router. That worked, but in spite of the promises on the box about covering a “medium household”, WiFi reception in my den was always feeble. The den is only two rooms away from the office with the router, but the room between is the bathroom, and so there is one tiled wall without an opening in the way. That appears to block the signal quite drastically, so it takes the long way around. It was okay for web surfing, but not ideal for things like Netflix streaming. And then I bought the Switch. The Switch has one major drawback regarding Wifi, in that it has the world worst WiFi antenna. When your tablet shows 2 bars instead of 3, the Switch already can’t find any signal at all any more. So I had to move the Switch next to the base station every time I wanted to download something. Time for an upgrade.

I surfed the internet for recommendations (which also told me that Linksys routers aren’t considered to be very good) and found that a lot of people liked the Netgear Orbi. Just to make sure I took the RBK50 system, which has both a base station and one satellite for range extension. I had tried a Linksys extender, which had worked to some degree, but failed to use the same SSID as the base station as promised on the box. With Netgear Orbi there was no problem. I could put the satellite in the den, and it would still get a good signal from the base station and then enhance it. So now I have 75 Mbit/s WiFi connection everywhere in my home! Even the Switch shows three bars of WiFi connection.

The fiddling was necessary to get my printers working, which didn’t like the Orbi switching to a completely new IP gateway address. So I had to change the Orbi to access point mode, which then mysteriously messed up everything and I had to factory reset my main router as well as the Orbi system to get everything working again. It is still a mystery to me why everything goes fast on a computer, except for network connections: Every time you reset a router or network card, it takes several minutes to establish a network.

Anyway, everything is working now, and at 15 times the speed necessary for Netflix HD streaming (or 3 times the speed for Netflix Ultra HD streaming, which I don’t have the Netflix streaming plan for). Which means that both me and my wife can stream video without a download on the computer slowing down by much. Nice!

What is PATH and CLASS-PATH all about in JaVa ?

What is PATH and CLASS-PATH 


Many problems in the installation and running of Java applications are caused by incorrect setting of environment variables (global system variables available to all the processes running under the system), in particular, PATH, CLASS-PATH.

PATH Variable:

PATH is basically an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.
When you launch a program from the command line, the operating system uses the PATH environment variable to search for the program in your local file system. PATH maintains a list of directories for searching executable programs.
If the program cannot be found in these directories, you will get an error. For example, if Java Compiler “javac.exe” is not found in the current directory and all the directories in the PATH, you will receive this error when compiling java source code:

ERROR:javac is not recognized as an internal or external command.



 For Java applications, PATH must include the following directories:
  • JDK’s “bin” directory (e.g., “c:Program Filesjavajdk1.7.0_{xx}bin”), which contains JDK programs such as Java Compiler “javac.exe” and Java Runtime “java.exe”.
  • “c:windowssystem32” and “c:windows” which contain console programs and commands.

How To set Path in java?

There are 2 ways to set java path:
  1. Temporary.
  2. Permanent.
1.Temporary path of JDK in windows:

  • Open command prompt
  • copy the path of jdk/bin directory
  • write in command prompt: set path=copied_path

Let’s see it in the figure given below:


2.Permanent path of JDK in Windows:
  • Right click on ‘My Computers’ and open ‘Properties’.
  • In Windows Vista or Windows 7, go to “Advanced System Settings”. Else go to next step.
  • Go to ‘Advanced Tab’ and click on Environment Variables button.
  • click on new tab of user variables
  • write path in variable name and paste path of bin folder in variable value.
  • Click on OK botton.

Setting JAVA path in Linux OS:

Setting the path in Linux OS is same as setting the path in the Windows OS. But here we use export tool rather than set. Let’s see how to set path in Linux OS:

export PATH=$PATH:/home/jdk1.6.01/bin/


CLASS-PATH in java:

The CLASS-PATH is an Environment variable is one way to tell applications, including the JDK tools, where to look for user classes. Class-path in Java is the path to directory or list of the directory which is used by Class-Loaders to find and load classes in Java program.
It would be impractical to have the JVM look through every folder on your machine, so you have to provide the JVM a list of places to look.  Therefore you need to set your class-path such that, JVM should be able to locate all your resources like classes, files, jars etc.
Setting CLASS-PATH:

In order to set Classpath for Java in Windows you need to specify the value of environment variable CLASSPATH, the name of this variable is not case sensitive and it doesn’t matter if the name of your environment variable is Classpath, CLASSPATH or classpath in Java.

Steps:

    How to se Java Classpath in windows and Unix Linux

  1. Go to Environment variable window in Windows by pressing  or you can go from rig“Windows + Pause “–> Advanced –> Environment variable ht click on my computer than choosing properties and then Advanced and then Environment variable this will open Environment variable window in windows.
  2. Now specify your environment variable CLASSPATH and put the value of your JAVA_HOMElib and also include CURRENT DIRECTORY by including (dot or period sign).

Now to check the value of Java classpath in windows type “echo %CLASSPATH” in your DOS command prompt and it will show you the value of directory which is included in CLASSPATH.

  • You can also set classpath in windows by using DOS command like:
set CLASSPATH=%CLASSPATH%;JAVA_HOMElib;

This way you can set the class-path in Windows XP, windows 2000 or Windows 7 and 8, as they all come with command prompt.


Setting CLASS-PATH in LINUX:

To set Class-path for Java In Linux, you can simply export CLASSPATH=”your classpath” from either your .bash_profile or .bashrc script which will run whenever your login into your Linux or Unix Machine. Now to check the value of Java CLASSPATH in Linux type “echo ${CLASSPATH}” this will print the value of Classpath in command prompt. By using the export command, you can set the classpath for Java in Unix, Linux, Solaris, or any other UNIX operating system. 
What are main differences between CLASSPATH and PATH?

  1. Path is an environment variable which is used by the operating system to find the executables. Classpath is an environment variable which is used by the Java compiler to find the path, of classes.i.e in J2EE we give the path of jar files.
  2. PATH is nothing but setting up an environment for operating system. Operating System will look in this PATH for executables. Classpath is nothing but setting up the environment for Java. Java will use to find compiled classes.
  3. Path refers to the system while classpath refers to the Developing Environment.

Want to learn more about java?

FCC officially repeals net neutrality rules: what now?

Huffington Post

Net neutrality is officially dead, but what does that mean for Internet users in the US and beyond? Will it ever come back? Read on to find out.

Editor’s Pick

Brief background

Unless you’ve been living under a rock for the past few months, you’ve probably heard a thing or two about net neutrality, an ongoing debate in the US. Net neutrality required service providers to treat every content equally: no throttling, blocking, or providing preferential treatment for additional fee. These rules were one of the Obama-era FCC’s signature achievements, but with Ajit Pai in charge, a former Verizon employee, and two other Republicans, the organization’s stance on net neutrality has changed drastically. The FCC wanted to get rid of net neutrality altogether and undo the classification of ISPs as Title II common carriers, and that’s precisely what they voted to do on December 14.

December 14 vote

As expected, the FCC voted 3-2 to repeal these landmark regulations just few days ago, the organization claiming that “the Internet wasn’t broken in 2015.” Pai commented, “We were not living in some digital dystopia. The main problem consumers have with the Internet is not and has never been that their Internet provider is blocking content. It’s been that they don’t have access at all.”

The two Democrat commissioners who dissented echoed the sentiments of net neutrality advocates: Jessica Rosenworcel says that the FCC’s “rash decision” gives Internet providers permission to “discriminate and manipulate your internet traffic.” Mignon Clyburn delivered a powerful and impassioned defense, claiming that the FCC’s vote was “particularly damning… for marginalized groups, like communities of color, that rely on platforms like the internet to communicate.”

Legal challenges?

Let’s first examine the legal implications, and the bottom line is that there will be lawsuits with a lot of interveners, challenging the FCC’s vote. Public interest groups like Free Press and Public Knowledge have already declared that they will challenge the repeal in court; the New York Attorney General Eric Schneiderman said he and other attorneys general from more than 15 states will file a legal challenge in the coming days.

These legal claims are likely to rely on the Administrative Procedures Act, which prohibits federal agencies from acting in a “capricious” manner, going back and forth on decisions with changes in political administration. However, as Wired points out, “As capricious as the current FCC’s about-face may seem, legal experts say the challenges won’t be a slam-dunk case. Federal agencies are allowed to change their minds about previous regulations, so long as they adequately explain their reasoning.” The onus is on the claimants to show that the FCC’s decision is a capricious one, which is going to be difficult to prove.

It’s going to be difficult to prove that the repeal was a capricious decision.

Net neutrality advocates may also point out that while the FCC claims that 7.5 million comments it received during the public review period were spam, created by bots, it is refusing to help investigations into what happened. It’s unlikely to have much weight, unfortunately.

Will average users feel the change?

Yes and no. It’s unlikely that Internet users in the US will be impacted – either positively or negatively ­– by the repeal overnight. As AT&T’s senior executive VP Bob Quinn points out, the Internet will “continue to work tomorrow just as it always has.” In fact, many service providers like AT&T, Comcast, and Verizon have promised not to block or throttle content. For now. The catch here is that their stance may change in the future, and even if it doesn’t and they continue to stay away from blocking or throttling content, they may still create fast lanes for their own services or for those who pay a premium.

Indeed, what we are likely to see in the future is an expanded form of zero-rating where service providers exempt certain streaming services from data counts. Carriers have been doing this even under net neutrality rules were (though the legal validity of this practice was called into question multiple times); without net neutrality rules, there is nothing even remotely getting in the way of these carriers from providing preferential treatment to its own streaming services.

Further, contrary to Pai’s statement that the Internet wasn’t broken even before 2015, and contrary to his supporters who claim that carriers won’t dare throttle or block content in fear of public backlash, the long-term effects of the FCC’s vote could be devastating. Comcast throttling BitTorrent connections, AT&T blocking voice-call services like Skype and FaceTime, or Netflix paying additional fees to Verizon are the sorts of behavior that we saw prior to net neutrality rules and there’s no reason why they wouldn’t return now that net neutrality rules have been repealed.

Comcast throttling BitTorrent or AT&T blocking FaceTime are the sorts of behavior that we saw prior to net neutrality rules.

Ultimately, the FCC’s decision gives significant leeway to ISPs: they may one day decide to block certain apps and websites, slow down content provided by competitors, bury relevant but unpaid search results, etc. Consumers in the US may end up having to choose Internet packages like TV channels, similar to what we see in some European countries. The most popular websites like Google, Amazon, and Netflix may one day be dispersed and inconveniently grouped into separate, overpriced packages. Want Google as well as Netflix? Pay up!

What about those outside the US?

Of course, given that the FCC is a US organization, its decision to repeal net neutrality rules won’t have a direct impact on other countries and users in other countries. However, if your country does have legislation similar to net neutrality rules, you might want to keep an eye on the political side of things. Policy decisions made in the US usually have a far-reaching indirect effect on neighboring countries, Anglophone countries, and countries that have special ties with the US.

Even if your country has made it clear that it wants to uphold net neutrality rules or the equivalent legislation, there may be financial factors to consider. If companies like Netflix or Spotify are adversely affected by the FCC’s decision in the US and are forced to pay more by ISPs, they will most likely increase monthly subscription fees for users in the US as well as for users outside the US.

What can you do?

Unfortunately, for those of you who are in support of net neutrality rules, there isn’t much to be done right now. Over the next few months, we will see legal battles between public interest groups and attorneys general and the FCC; we will see heated political debates; we will see predictions from both sides – those who are in favor and those who are not. Only time will tell if net neutrality rules were indeed preventing the arrival of cyber-dystopia or if they were simply an obstacle to corporate profit and further investment.

The T-Mobile HTC U11 Life is getting Android 8.0 Oreo (updated)

Update (12/18/17): Just about three weeks ago, the unlocked HTC U11 Life was upgraded to Android 8.0 Oreo. Now, the T-Mobile variant is receiving the update as well. T-Mobile is the only carrier in the United States to carry the HTC U11 Life so between it and the unlocked versions, pretty much everyone should be updated to Oreo at this point.

HTC warns that this is a pretty large download so you’ll need to connect to Wi-Fi before you start. As a reminder, Oreo brings background limits on apps that help to save power, smart text selection, grouped notifications, and picture-in-picture mode, among other features. To read more about Oreo, check out our review here.

Original article (11/30/17): The HTC U11 Life was introduced earlier this month, arriving on the Android One program in global markets (with almost stock Android), while those in the US received a variant with HTC’s Sense UI. The device launched with Android Oreo outside of the US, meaning those residing in the States were left waiting for the latest Google software, but HTC assured that it wouldn’t be far off.

Today, I bring good news as the US unlocked U11 Life is now said to be receiving Oreo. HTC Vice President of Product Manager Mo Versi delivered the news via a Tweet published a couple of hours ago. Versi said that the update would be available “starting today,” but we don’t know how long it could take to hit individual devices.

HTC has been on a roll with its rollouts this week, having upgraded the regular HTC U11 flagship to Oreo just a couple of days ago. Here’s hoping the speedy updates continue for the rest of its smartphone lineup.

Check out our full HTC U11 Life review at the link and visit our dedicated Android 8.0 Oreo update page to find out more about HTC’s schedule.

Elemental Evil: Session 11

In the previous session the group entered Rivergard Keep, the second of the elemental evil surface keeps. More by chance than by design they had managed to enter directly into the main building where the boss resided. However the boss was described in the adventure as being a wereboar who was out hunting at night. So the group ended up looting his room without having killed the boss. But that only got them treasure, and not the elemental key they were after.

Searching the building further resulted in them finding a group of commoners sleeping in a dormitory next to the kitchen. They carefully abducted one without waking up the others and questioned him. That gave them a bit more information about the keep and the boss, including the fact that he was out hunting and would return later in the night. But first they searched the great hall and found a letter in which somebody from Red Larch warned about a group of troublemakers, giving the description of the group. They also found a secret door, leading to a staircase downwards.

They followed the staircase and ended up at a landing of an underground river, complete with two rowboats. So they boarded those and followed the river further. However the river was guarded by a group of aquatic ghouls, who managed to topple one of the boats, which made the combat somewhat more interesting. Poppée the wild magic sorceress tried to save herself with magic, which resulted in a wild magic surge that ended up randomly summoning a unicorn. The unicorn was understandably confused by being summoned into water, and decided to “save” Poppée by teleporting her and itself out. But of course the others didn’t know what happened, only that Poppée had disappeared. After killing the ghouls it turned out that the way was blocked anyway, by the same sort of portal they had already encountered near Feathergale Spire, requiring the 4 elemental keys to open. (An addition of mine to the adventure to prevent them from randomly wandering into a dungeon of 4 levels higher than the surface keep).

The group went back up into the keep and in the courtyard also found back Poppée. However in preparation of the adventure I had decided to randomize the time of return of the keep boss by letting the group roll for an encounter every time they crossed the way the boss would take home. And by chance this encounter now took place. As the boss had an entourage the fight was challenging, with a priest of the water cult casting sleet storm on the group. The group managed to kill the opponents without waking the rest of the keep up, but the paladin got bitten by the wereboar.

As the boss had the elemental key on him, the group decided to flee and leave the rest of the water keep be. On the one hand that was understandable and consistent with their actions in the air keep. But technically they are skipping a bunch of combat encounters and thus xp. I think I need to make sure that they don’t kill the boss of the next keeps too early and rush through the adventure, the adventure isn’t designed for that.

3D printing larger objects

Since I bought my 3D printer I have printed hundreds of miniatures for my Dungeons & Dragons game. The miniatures are in a classic 1 inch = 5 feet that is 1:60 scale. So a typical medium sized miniature has a 25 mm base and is around 28 mm tall. As I have written earlier, the main problem of printing objects that size is that printing anything less than 1 mm thick tends to fail, so I had to “fatten” some miniatures or give them oversized weapons to work. Now that I have a good selection of miniatures, I am more often printing larger objects, and the challenges are different.

Now “larger objects” on my 3D printer are limited to 150 mm in any dimension due to the size of the printer itself. Over the last month I printed several objects that were at or close to that limit: Two dice towers, a hinged box, a card tray and two card holders for the 7th Continent, and JoyCon holders for the Nintendo Switch. Apart from the box, which was more of a tech demo to show that you can print a hinged object in one piece, the other objects would be either hard to get anywhere, or be much more expensive. Thus there is some utility to printing these larger objects yourself. The 3D printer also automatically makes items hollow, filled with some honeycomb structure, so a bulky 3D printed object is quite lightweight.

While with larger objects there are no more problems with too thin parts, the main downside of these objects is that the uneven surface is far more prominent. If you are used to holding plastic items in your hand which have a smooth and shiny surface, the 3D printed objects are notably different. Along the Z-axis the layer structure is very visible. And on inner surfaces where the printer had to move across empty space to get to the other side of the object there are irregular imperfections. To some extent you can clean the object up using a sanding sponge. But unless you want to spend hours sanding the object will never be totally smooth and shiny like a commercial injection-molded item.

I still don’t believe in a future where we all just 3D print everything we need instead of buying mass-produced items. However there are a few niche applications where a 3D printer can produce a larger object of some use.

Elemental Evil: Session 10

In the previous session the group had attacked Feathergale Spire, the first stronghold of the elemental evil cult of air. There they had killed the lord of the tower, his guest Glasstaff (a mage they had been chasing since several sessions before) and three knights, before escaping from the top of the tower with magical para-glider suits. While having escaped unseen, the attack hadn’t gone unnoticed. So while they were at breakfast the next morning in the tavern in Red Larch, a local poultry merchant came in telling the news: “Bandits” had attacked Featherscale Spire, and the survivors of the Feathergale Society had decided to quit the tower, leaving only a single guardian behind. The merchant was quite distraught over the news, as he had had a nice business selling provisions to the tower, which now needed much less of them.

Feigning concern the group then went to the tower, this time ringing the bell at the front door. As chance would have it, the sole guardian of the tower was Savra, a young noble, who knew Theren from Waterdeep. Being a novice of the cult and a bit naive and trusting towards somebody she knew, Savra told the group that “the prophetess” aka Aerisi Kalinoth (the lady on the cover of the Princes of the Apocalypse book) had come and taken the rest of the Feathergale Society with her through the magical portal into the temple below. Asking about the door the group learned that the cults knew there were 4 keys to open the portal, but as nobody had all 4 keys that was not the usual way to open it; instead the prophetess opens the door with the help of her magical spear. Savra has no means to contact the prophetess or the rest of the Feathergale Society, and was told to wait in the tower. While Theren was chatting with Savra, other group members searched the tower, but of course everything of value or incriminating had been removed.

From there the group moved towards the Dessarin River, with the idea to move north from there and find Rivergard Keep, the suspected stronghold of the elemental evil cult of water. Near the river they came upon a scene where a group of water cultists was harassing a bear, with the bear curiously shouting for help in common. A fight ensued in which the group slew the cultists and rescued the druid/bear. The rescued druid, Varigo, was very grateful and gave them his most prized possession, the Talking Bear Statuette, a magical item allowing a druid in wild shape to talk and even cast 1 spell per transformation. [DM’s note: Our druid needed a boost due to the weird power curve of the moon druid compared to other classes, which results him being powerful at level 2, but not growing in power much until level 6, while everybody else surpasses him at level 5. It also solves the stupid problem that moon druids sometimes would like to remain in animal shape between fights, but would then be excluded from discussing plans with the rest of the group.] Varigo also told the group that he was on the way to Scarlet Moon Hall to witness the Rite of the Wicker Giant, a ritual that is supposed to restore nature’s balance in the troubled region.

The next day the group reached Rivergard Keep. The keep was well guarded, with patrols on the walls. So after some discussion on how to approach the group decided to climb the wall during the night under cover of a silence spell. They killed the wall guard, and then entered through a door into the second floor of the keep. There they managed to kill 6 crushing wave reavers (the elite soldiers of the keep) without raising an alarm. Having thus successfully infiltrated the keep, we stopped the session there, to continue in the new year.

On a personal note, the player of the paladin was absent, so my wife played her character. That was the first time my wife played a real role-playing game. I don’t think she will play frequently, but it is nice that she now knows a bit better what we are doing when we play.

Working with Microsoft SQL Server


MS SQL Server


What is SQL Server Management Studio?

SQL Server Management Studio (SSMS) is the main administration console for SQL Server.


SSMS enables you to create database objects (such as databases, tables, stored procedures, views etc), view the data within your database, configure user accounts, perform backups, replication, transfer data between databases, and more.

Fig 3 : SSMS Console Window


User Login :


When creating a new user login, the administrator can assign that login to any number of roles and schemas. This will depend on what that particular login is entitled to.


Create a New Login

Step 1 :  Using SQL Server Management Studio, expand the Security option (at the
server level, not at the database level) and right click n Logins.

Step 2 :  Click on New Login.

Step 3 :   Complete the login properties in the General tab by providing a name for the login, choosing the Authentication method (providing a password if you choose SQL Server authentication), and selecting the database to use as a default.

Step 4 :   Click the Server Roles tab if you need to apply any server-wide security privileges.


Step 5 :
Click the User Mapping tab to specify which databases this user account is allowed to    access. By default, the login will be assigned to the Public role, which provides the login with basic access.
 If the login needs more access in one or more databases, it can be assigned to  another role with greater privileges. In this case, select Task Tracker database  and  db_owner role for that database.
Step 6 :  Click OK to create the login.


NOTE :
These roles are database roles and are different to the server roles in the previous tab. Server roles are for administering the SQL Server. Database roles are more limited. They are created within each database and specify what the login can do within that particular database.




Fig : Server Roles

Server Roles :


When we created a SQL Server login, we had the option of assigning the login one or more server roles. Server roles (not to be confused with database roles) are available to manage permissions on a server.


View the server roles in SSMS, from the Object Explorer, expand the Security folder







Database :

A database is a collection of information that is organized so that it can be easily accessed, managed and updated.
Creating a database can be done by running a SQL script or by “point and click”. 


System Databases

When you install SQL Server, the following four databases are created.
1.master
This database stores system level information such as user accounts, configuration settings, and info on all other databases.
2.model
This database is used as a template for all other databases that are created.
3.msdb
The msdb database is used by the SQL Server Agent for configuring alerts and scheduled jobs etc
4.tempdb


This one holds all temporary tables, temporary stored procedures, and any other temporary storage requirements generated by SQL Server.  


Create Database :

Fig 4 : Create DB 
The following steps demonstrate how to create a database in SQL Server 2014 using SQL Server Management Studio.

Step 1 : From the Object Explorer, right click on the Databases folder/icon and select New Database

Step 2 : 
Name your database and click OK:


Database with the Given Name will be created.

NOTE :
The new database is based on the Model database (System Database).
It already contains system functions, system views, system stored procedures, and (hidden) system tables. These are system objects which provide information about the database.


Create Table :

Fig 5 : Create Table
Steps to create a table in a database using SQL Server Management Studio (SSMS).

Step 1 :   Ensuring you have the correct database expanded (in our case, the TaskTracker database), right click on the Tables icon and select Table

Step 2 :   A new table will open in Design view. Fill in Column_name, Datatype & if(Null) checkbox for making column .
  ( for more options such as PRIMARY KEY, is Identity, etc. right click on left pane of  required tuple to add property )

Step 3 :   Save the table by selecting File > Save able_1 or by right-clicking on the Table’s  tab and selecting. 
Save Table_1  from the contextual menu:  





Insert Data :
There are many ways of getting data into your database. 



1.Manually: Type data directly into your table rows.


2.Copy/Paste: Similar to the previous option, but this one is where you copy data from another source, then paste it into a table in your database.

3.Import: You can use the Import and Export Wizard to import data from another source.

4.SQL Scripts: You can run a SQL script that contains all data to insert.

5.Application/Website: Users update the database via an application or website.





1. Manually


We can use the Edit Top 200 Rows option to manually type data directly into the table rows. Manually entering data is OK if you only have a little bit of data to enter.


Steps :
1. In the Object Explorer, right click on the table you wish to open, and select Edit Top 200 Rows:
2.You can now start entering the data directly into your table.


2. Copy/Paste


You could use a similar method to the above by copying from another datasource and pasting into your database table. This is OK for a small number of records but not for a lot of records.


Steps :

1. Select all required records from the datasource

2. In the destination database (i.e. the one you want to populate with data), right-click on the destination table and select Edit Top 200 Rows. 

3. Select an empty row by right-clicking in the left-most column (it’s more of a button to the left of your left-most column that allows you to select the whole row) and select Paste from the contextual menu:


3 (a). Import 
You can import data from another datasource. The end result is similar to the copy/paste method (i.e. data is copied across to the destination database), but importing the data is more flexible and could be more suitable on many occasions.

Steps :
To import data, right-click on the database and select Tasks > Import Data… and follow the Wizard from there.

The SQL Server Import and Export Wizard can copy data to and from any data source for which a managed .NET Framework data provider or a native OLE DB provider is available. These include:
•SQL Server
•Flat files
•Microsoft Office Access
•Microsoft Office Excel


Start the SQL Server Import and Export Wizard to import data from an Excel worksheet to a SQL Server database. Click Next to bypass the welcome screen. On the Choose a Data Source page (Figure 8), configure the following:

Fig 6: Import Wizard


Step 1 : (Data Source)
Choose Microsoft Excel from the drop-down menu.

Step 2 : (Excel File Path )
Specify the path of the Excel file from which you are importing data.

Step 3: (Excel Version)
Choose the Excel version where you created the Excel.

Click Next to go to the Choose a Destination page (Figure 9), and configure the following:



Step 4 : (Data Source)
Choose SQL Server Native Client 11.0 from the drop-down menu.

Step 5 : (Server Name )
Fig 7 : Import Wizard Client

Type the name of the destination database’s SQL Server instance.

Step 6 : (Authentication)
Choose the appropriate authentication mode for the data destination connection.

Step 7 : (Database )
Choose which database to copy the data into.








Fig 8 : Finish Import

Step 8 :
Click the Next button to go to the Save and Run Package page. Here, select the Run immediately option and click the Next button. 

This takes you to the Complete the Wizard page where you can view the choices you made.

Click Finish to run the package.




3 (b). Exporting data  (from a SQL Server DB to a Microsoft Excel worksheet) :

To export data, start the SQL Server Import and Export Wizard. Then, click the Next button to bypass the Welcome Screen. On the Choose a Data Source page configure the following:

Step 1 : (Data Source )
Fig 9 : Export Wizard

 Choose SQL Server Native Client 11. from the drop-downmenu.

Step 2 : ( Server Name)
Type the name of the SQL Server instance that contains the source data.

Step 3 : (Authentication)
Choose authentication mode for the data source connection.

Step 4 : (Database)
 Choose the database that contains the source data.
Click Next to go to the Choose a Destination page (Figure 2). On this page, configure the following:





Fig 10 : Export Wizard Target

Step 5 : (Destination)
Choose Microsoft Excel from the drop-down menu.

Step 6: (Excel File Path)
Type in the Microsoft Excel worksheet operating system path.

Step 7 : (Excel Version)
Select the version of the Microsoft Excel worksheet.





Step 8:
Fig 11 : Finish Export 

Click the Next button to go to Review Data Type Mapping page. 

This is where you’ll see how different data types are mapped between the source and the destination and how any conversions issues will be handled.

Follow the wizard ahead.




4. SQL Scripts :
In many cases, you will find it more efficient to run a SQL script that contains the data you need to insert. You can use the SQL INSERT statement to insert just the data you specify in the statement.

Eg :
USE [Database_Name] 
GO
INSERT INTO Table_Name (column_name1,column_name2,column_name3) VALUES (‘val1’, ‘val2’, ‘val3’)
5. Application / Website


Server databases are the backend data storage for a front-end application. Users of the application are responsible for adding data to the database (as well as editing it). 
The Difference between these scripts and above scripts is, these scripts are dynamic. i.e Parameters are passed dynamically to the database.

T-SQL Scripts :

1. Create Database :
Creates a user defined database which can hold n number of user defined tables.

Syntax :
Create database

Query :
CREATE DATABASE SCTPL


2. Create Table :
Creates a user defined table which can hold n number of column with their respective constraints defined by user.

Syntax :
USE [DatabaseName]
GO
CREATE TABLE table_name
(
column_name1 Datatype,
column_name2 Datatype,
column_name3 Datatype
)

Query :
USE [SCTPL]
GO
CREATE TABLE Testdb
(
PrimaryID  int PRIMARY KEY IDENTITY,
Year  varchar(255)
)

3. Drop Table :
The SQL Server DROP TABLE statement is used to remove a table definition and all data, indexes, triggers, constraints, and permission specifications for that table.

Syntax :
USE [Database_Name]
GO
DROP TABLE table_name

Query :
USE [SCTPL]
GO
DROP TABLETEST


4. Insert Into :

The SQL Server INSERT INTO statement is used to add new rows of data to a table in the database.

Syntax :
USE [Database_Name]
GO
INSERT INTO Table_Name (column_name1,column_name2,column_name3) VALUES(‘val1’, ‘val2’, ‘val3’)

Query :
USE [Database_Name]
GO
INSERT INTO Table_Name (Year, Country, Location)
VALUES (‘1996′,’Nigeria’,’Akwa Ibom’)
4. Select :
SQL Server SELECT statement is used to fetch the data from a database table which returns data in the form of result table. These result tables are called result-sets.
Syntax :
/*For selecting all entries*/
USE [Database_Name]
GO
SELECT * FROM TEST
/*For selecting Specific entries*/
USE [Database_Name]
GO

SELECT column_name1, column_name2 FROM Table_name


Query :
/*For selecting all entries*/
USE [Database_Name]
GO
SELECT * FROM TEST
/*For selecting Specific entries*/
USE [SUVEN]
GO
SELECT Year, Country FROM TEST
5. Update :
The SQL Server UPDATE Query is used to modify the existing records in a table.
You can use WHERE clause with UPDATE query to update selected rows otherwise all the rows would be affected.

Syntax :
/* Type 1 */
Use [Database_Name]
GO
UPDATE table_name SET column1 = value1, column2 = value2…., columnN = value WHERE [condition]
/* Type 2 */
USE [Database_Name]
GO
UPDATE TABLE_NAME
SET COLUMN_NAME = ‘val1′, Column_name =val


Query :
/* Type 1 */
USE [SUVEN]
GO
UPDATE TEST
SET Location = ‘RenamedColumn Akwa-Ibom
WHERE Location = ‘Akwa Ibom
/* Type 2 */
UPDATE CUSTOMERS SET ADDRESS = Pune‘, SALARY = 1000.00



6. Delete :
The SQL Server DELETE Query is used to delete the existing records from a table.
You have to use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted.

Syntax :
/*For selecting specific entries*/
USE [Database_Name]
GO
DELETE FROM table_name WHERE [condition]
/*For selecting all entries*/
DELETE FROM column_name

Query :
/*For selecting specific entries*/
USE [SUVEN]
GO
DELETE FROM TEST
WHERE SALARY = 1000
/*For selecting all entries*/
DELETE FROM Location



Clauses

1. WHERE Clause:

The MS SQL Server WHERE clause is used to specify a condition while fetching the
data from single table or joining with multiple tables.

If the given condition is satisfied, only then it returns a specific value from the table. You will have to use WHERE clause to filter the records and fetch only necessary records.
The WHERE clause is not only used in SELECT statement, but it is also used in

UPDATE, DELETE statement, etc.


Syntax :
SELECT column1, column2, columnN FROM table_name WHERE [condition]

Query:
SELECT name FROM Stud WHERE id=1


2. LIKE  Clause:

The MS SQL Server LIKE clause is used to compare a value to similar values using wildcard operators. There are two wildcards used in conjunction with the LIKE operator 
  1. The percent sign (%)
  2. The underscore (_)
The percent sign represents zero, one, or multiple characters. 
The underscore represents a single number or character. The symbols can be used in combinations.

Syntax:


/* Type 1 */
SELECT *column-list FROM table_name WHERE column LIKE ‘%XXXX%’
/* Type 2 */
SELECT *column-list FROM table_name WHERE column LIKE ‘_XXXX_’

Query:

/* Type 1 */
SELECT name from Stud
WHERE sid LIKE ‘200%’
(Finds any values that start with 200)
/* Type 2 */
SELECT name from Stud
WHERE SALARYLIKE ‘_00_’
Finds any values that have 00 in the second and third positions & is of four characters. 


3. ORDER BY


The MS SQL Server ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns. Some database sort query results in ascending order by default.


Syntax :

Use DatabaseName
Go
SELECT columnlist FROM table_name [WHERE condition] [ORDER BY column1, column2, .. columnN] [ASC | DESC]

Query :

/*TYPE 1*/
Use SUVEN
Go
SELECT * FROM Stud ORDER BY NAME

/*TYPE 2*/

SELECT * FROM Stud ORDER BY NAME DES

4. GROUP BY Clause :

The SQL Server GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups.

The GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause.

Syntax :

UseSUVEN
Go

SELECT column1, column2 FROM table_name WHERE [ conditions ] GROUP BY column1, column2 ORDER BY column1, column2

Query: 

UseSUVEN
Go
SELECT NAME, SUM(SALARY) as [sum of salary] FROM Stud GROUP BY NAME

6. DISTINCT

The MS SQL Server DISTINCT keyword is used in conjunction with SELECT statement to eliminate all the duplicate records and fetching only unique records.


There may be a situation when you have multiple duplicate records in a table. While fetching such records, it makes more sense to fetch only unique records instead of fetching duplicate records.


Syntax :

Use Suven
Go

SELECT DISTINCTcolumn1, column2,…..columnN FROM table_nameWHERE [condition]

Query :
Use SUVEN
Go
SELECT DISTINCT SALARY FROM CUSTOMERS ORDER BY SALARY 


Joins :

The MS SQL Server Joins clause is used to combine records from two or more tables in a database. A JOIN is a means for combining fields from two tables by using values common to each.

MS SQL Server Join Types −

There are different types of joins available in MS SQL Server −

INNER JOIN         −  Returns rows when there is a match in both tables.

LEFT JOIN            −  Returns all rows from the left table, even if there are no matches in the  
                                  right table.

RIGHT JOIN         −  Returns all rows from the right table, even if there are no matches in the 
                                  left  table.

FULL JOIN            −  Returns rows when there is a match in one of the tables.

SELF JOIN             − This is used to join a table to itself as if the table were two tables, 
                                 temporarily renaming at least one table in the MS SQL Server statement.

CARTESIAN JOIN − Returns the Cartesian product of the sets of records from the two or 
                                  more joined tables.

NOTE :

The join is performed in the WHERE clause. Several operators can be used to join tables, such as =, <, >, <>, <=, >=, !=, BETWEEN, LIKE, and NOT; they can all be used to join tables. However, the most common operator is the equal symbol.


Query Designer :

The query designer is a graphical user interface that assists in building queries for your SQL Server database. This can be particularly useful when building complex queries that involves many tables, views etc.

The Query Designer can also be beneficial for those who are learning how to write SQL. By using the Query Designer to generate the SQL, you can study the SQL and learn the syntax as you go.

Step 1 :  Open a new query by clicking New Query on the toolbar


Step 2 :  Open the Query Designer by selecting Query > Design Query in Editor. from the top menu:

Step 3 : Select the tables you want to run the query against (in this case, we will add both tables), click Add, and close the box by clicking Close:


Step 4 :  
Select the column/s you want to display in your query by checking the checkbox next to the column name. In the middle pane, you can deselect an Output checkbox to hide that field from being displayed when the query is run (but the field will still be involved in the query).

 Add a value under Filter to narrow the results down to only those you’re interested in (in this example, it is creating a WHERE clause to select only those records with a StatusId of “1” – which is “To Do”):

Step 5 :
Click OK once you’re happy with your query. Query will be automatically  Generated by query designer. Execute it using f5 key.


Views :

In SQL Server, a view is a pre-written query that is stored on the database. A view consists of a SELECT statement, and when you run the view, you see the results of it like you would when opening a table. 

Some people like to think of a view as a virtual table. This is because a view can pull together data from multiple tables, as well as aggregate data, and present it as though it is a single table.
Syntax :

CREATE VIEW ViewName AS
SELECT …

Query :

CREATE VIEW ToDoList AS
SELECT  Tasks.TaskName, Tasks.Description
FROM  Status INNER JOIN
Tasks ON
Status.StatusId = Tasks.StatusId
WHERE  (Status.StatusId = 1)
NOTE : Tasks & Status are two different Tables in a single database.


To execute a View  : 

Syntax : select * from View_name


NOTE :
The view will return upto date data. If the data in the table changes, the results of the view will change too. So if you were to add a new task with a status of “To Do”, next time you run the view, it will include the new record in the result set.


Stored Procedures :

A stored procedure will typically contain some business logic. For example, a stored procedure can accept parameters that are passed to it and test against those parameters using IF statements. Eg, if the parameter is one value, do this, if it’s another value, do that.

Benefits of Stored Procedures :

1. Modular programming
You can write a stored procedure once, then call it again and again, from different parts of an application (and even from multiple applications).

2. Performance
Stored procedures provide faster code execution and reduce network traffic.

3. Security
Users can execute a stored procedure without needing to execute any of the statements directly. Therefore, a stored procedure can provide advanced database functionality for users who wouldn’t normally have access to these tasks, but this functionality is made available in a tightly controlled way.

Create a Stored Procedure :

To create a stored procedure, you need to use the CREATE PROCEDURE statement, followed by the code that makes up the stored procedure. If your stored procedure is going to accept parameters, they need to be included after the name.

Syntax :

CREATE PROCEDURE myStoredProcedure AS
OR
CREATE PROCEDURE myStoredProcedure @{Parameter Name} {data type} AS

Query :

CREATE PROCEDURE
LatestTasks @Count int
AS
SET ROWCOUNT @Count
SELECT TaskName AS LatestTasks, DateCreated
FROM Tasks

ORDER BY DateCreated DESC


Execute a Stored Procedure

1. T-Sql Script :

Now that you’ve created your stored procedure, any time you want to execute it, you need to call it using either EXECUTE or EXEC. If the stored procedure requires parameters you provide those after the procedure name. 


Syntax :
EXECUTE LatestTasks
EXEC LatestTasks
OR
EXEC LatestTasks @Count = 5





2. Using The GUI

Step 1 : Using the Object Explorer, navigate to the stored procedure.

Step 2 : Right click on the stored procedure and select Execute Stored Procedure.

Step 3 : A dialog will appear. Enter your parameter values.

Step 4 : Click OK. SQL Server will generate the SQL code and execute the stored 




System Stored Procedures :

SQL Server includes a large number of system stored procedures to assist in database administration tasks. Many of the tasks you can perform via the GUI can be done via a system stored procedure. For example, some of the things you can do with system stored procedures include:
  • Configure security accounts
  • Set up linked servers
  • Create a database maintenance plan
  • Create full text search catalogs
  • Add remote login
  • Configure replication
  • Set up scheduled jobs
  • and much more…
NOTE :
System Stored Procedure has a prefix sp_ as naming convention.
It is a good idea to develop a consistent naming convention for your stored procedures, like usp_,  select_ , etc.