Tag: AI

  • The AI/Human Spectrum

    I was asked this question recently: is it more likely that AI will replace humans or assist them in their work?

    It’s a good question. If you think about the way AI is being hyped in 2024, many people think AI is, or will soon be, replacing people and we need less of them in work. I guess the simplified view is that AI can do the jobs of many people, but I’m not sure the world is that simple. What I think is more likely is that AI becomes a lever that assists a few people in getting more work done and potentially replacing other, less knowledgable humans.

    Maybe it’s the ultimate, do-more-with-less pressure that the management in many organizations places on workers that has people looking to AI to help. Get more done this year, but we’re not adding staff, and potentially we’re removing a few staffers. Maybe AI can do your job?

    AI can be a lever, and I do think that there are tedious tasks that we might have AI take on for us. We’ll need more of an agent/proxy approach to AI systems, as now I can ask AI to do some things that relate to text/images, but not actually do work for me. I want an AI to actually set my Out-of-Office for me, not give me instructions on how to do it or write the message for respondents.

    The current Generative AI/LLM systems aren’t really smart or intelligent, but they do process vast amounts of data and mimic the responses that other humans might give. If you work in an area that can benefit from that type of interaction, maybe an AI works well as a lever and lets you get more done on any given day. For some jobs.

    However, getting more done might not be enough. If I pair program with someone else and they write a bunch of poorly performing code, it takes me time to judge the quality of what they’ve written and then additional time to fix it. Getting more done in that situation can be a burden because the additional code produced requires additional rework. I might get less work done in some cases if the code is low-quality and I use a lot of time to rewrite or improve the code.

    However, if I am tackling simple tedious tasks, perhaps basic CRUD work in an application, maybe an AI can generate enough SQL, web, C#, etc. code that the job is done quicker. Maybe not at the most efficient level, but how many of you think the code for your internal applications is amazing? Is it good enough? Can an AI do “good-enough” work?

    As with a lot of dramatic changes to technology, I find myself going back and forth on the value produced. Some days I think the tech is amazing and some days I think it’s akin to the stuff I shovel out of horse stalls. AI is in the same boat with me, and while I think there is potential, I know that there are also downfalls and potential detractions from its widespread use.

    Certainly, the need to evaluate and judge quality is a challenge with AI, which leans me towards the lever that assists talented humans and replaces less talented ones. The other issue is cost. The LLMs are expensive, and use a lot of compute power. I’ve seen some smaller models, perhaps tailored with RAG or other methods of refining (and limiting) their use will overcome that, but who knows. The current models, however, cost something to run and someone is going to have to pay for that. Is there enough ROI to do that?

    Lastly, trust. Can we really trust an AI to give us accurate responses, or even perform work on our behalf? We have that problem with other humans now, but they work slowly compared to a computer. Can you imagine the problems that a rogue computer system could create with access to change things in the real world?

    Answer my question today. Are AIs more likely to assist or replace people?

    Steve Jones

    Listen to the podcast at Libsyn, Spotify, or iTunes.

    Note, podcasts are only available for a limited time online.

  • AI Helping with an API

    Can an AI help me with some database API work? Let’s see.

    This is part of a series of experiments with AI systems.

    The Scenario

    One of the things that helped me support a number of development teams with their database work was having code generate code. I had a piece of code that could read the system tables in SQL Server and produce insert, update, and delete procedures.

    I wondered if an AI could do this easily.

    Using Copilot

    I decided to try this first in the Edge Copilot window. I wrote this prompt:Create the T-sQL code for insert, update, and delete procedures for these tables:

    I then pasted in the code for 5 tables from Northwind, such as this one:

    CREATE TABLE "Employees" ( "EmployeeID" "int" IDENTITY (1, 1) NOT NULL , "LastName" nvarchar (20) NOT NULL , "FirstName" nvarchar (10) NOT NULL , "Title" nvarchar (30) NULL , "TitleOfCourtesy" nvarchar (25) NULL , "BirthDate" "datetime" NULL , "HireDate" "datetime" NULL , "Address" nvarchar (60) NULL , "City" nvarchar (15) NULL , "Region" nvarchar (15) NULL , "PostalCode" nvarchar (10) NULL , "Country" nvarchar (15) NULL , "HomePhone" nvarchar (24) NULL , "Extension" nvarchar (4) NULL , "Photo" "image" NULL , "Notes" "ntext" NULL , "ReportsTo" "int" NULL , "PhotoPath" nvarchar (255) NULL , CONSTRAINT "PK_Employees" PRIMARY KEY CLUSTERED ( "EmployeeID" ), CONSTRAINT "FK_Employees_Employees" FOREIGN KEY ( "ReportsTo" ) REFERENCES "dbo"."Employees" ( "EmployeeID" ), CONSTRAINT "CK_Birthdate" CHECK (BirthDate < getdate()) ) GO CREATE INDEX "LastName" ON "dbo"."Employees"("LastName") GO CREATE INDEX "PostalCode" ON "dbo"."Employees"("PostalCode") GO

    I got this result:

    -- Insert Procedure
    CREATE PROCEDURE InsertEmployee
         @LastName nvarchar(20),
         @FirstName nvarchar(10),
         @Title nvarchar(30),
         @TitleOfCourtesy nvarchar(25),
         @BirthDate datetime,
         @HireDate datetime,
         @Address nvarchar(60),
         @City nvarchar(15),
         @Region nvarchar(15),
         @PostalCode nvarchar(10),
         @Country nvarchar(15),
         @HomePhone nvarchar(24),
         @Extension nvarchar(4),
         @Photo image,
         @Notes ntext,
         @ReportsTo int,
         @PhotoPath nvarchar(255)
    AS
    BEGIN
         INSERT INTO Employees (LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath)
         VALUES (@LastName, @FirstName, @Title, @TitleOfCourtesy, @BirthDate, @HireDate, @Address, @City, @Region, @PostalCode, @Country, @HomePhone, @Extension, @Photo, @Notes, @ReportsTo, @PhotoPath)
    END
    GO
    -- Update Procedure
    CREATE PROCEDURE UpdateEmployee
         @EmployeeID int,
         @LastName nvarchar(20),
         @FirstName nvarchar(10),
         @Title nvarchar(30),
         @TitleOfCourtesy nvarchar(25),
         @BirthDate datetime,
         @HireDate datetime,
         @Address nvarchar(60),
         @City nvarchar(15),
         @Region nvarchar(15),
         @PostalCode nvarchar(10),
         @Country nvarchar(15),
         @HomePhone nvarchar(24),
         @Extension nvarchar(4),
         @Photo image,
         @Notes ntext,
         @ReportsTo int,
         @PhotoPath nvarchar(255)
    AS
    BEGIN
         UPDATE Employees
         SET LastName = @LastName, FirstName = @FirstName, Title = @Title, TitleOfCourtesy = @TitleOfCourtesy, BirthDate = @BirthDate, HireDate = @HireDate, Address = @Address, City = @City, Region = @Region, PostalCode = @PostalCode, Country = @Country, HomePhone = @HomePhone, Extension = @Extension, Photo = @Photo, Notes = @Notes, ReportsTo = @ReportsTo, PhotoPath = @PhotoPath
         WHERE EmployeeID = @EmployeeID
    END
    GO
    
    
    
    
    -- Delete Procedure
    CREATE PROCEDURE DeleteEmployee
         @EmployeeID int
    AS
    BEGIN
         DELETE FROM Employees WHERE EmployeeID = @EmployeeID
    END
    GO
    
    

    Here’s an image of what I saw:

    2024-11_0126

    You might ask if this is better than what I’d write. I wondered myself, so I asked it to change the update procedure slightly. Here’s the prompt and result:

    2024-11_0127

    -- Update Procedure
    CREATE PROCEDURE UpdateEmployee
         @EmployeeID int,
         @LastName nvarchar(20) = NULL,
         @FirstName nvarchar(10) = NULL,
         @Title nvarchar(30) = NULL,
         @TitleOfCourtesy nvarchar(25) = NULL,
         @BirthDate datetime = NULL,
         @HireDate datetime = NULL,
         @Address nvarchar(60) = NULL,
         @City nvarchar(15) = NULL,
         @Region nvarchar(15) = NULL,
         @PostalCode nvarchar(10) = NULL,
         @Country nvarchar(15) = NULL,
         @HomePhone nvarchar(24) = NULL,
         @Extension nvarchar(4) = NULL,
         @Photo image = NULL,
         @Notes ntext = NULL,
         @ReportsTo int = NULL,
         @PhotoPath nvarchar(255) = NULL
    AS
    BEGIN
         UPDATE Employees
         SET LastName = COALESCE(@LastName, LastName),
             FirstName = COALESCE(@FirstName, FirstName),
             Title = COALESCE(@Title, Title),
             TitleOfCourtesy = COALESCE(@TitleOfCourtesy, TitleOfCourtesy),
             BirthDate = COALESCE(@BirthDate, BirthDate),
             HireDate = COALESCE(@HireDate, HireDate),
             Address = COALESCE(@Address, Address),
             City = COALESCE(@City, City),
             Region = COALESCE(@Region, Region),
             PostalCode = COALESCE(@PostalCode, PostalCode),
             Country = COALESCE(@Country, Country),
             HomePhone = COALESCE(@HomePhone, HomePhone),
             Extension = COALESCE(@Extension, Extension),
             Photo = COALESCE(@Photo, Photo),
             Notes = COALESCE(@Notes, Notes),
             ReportsTo = COALESCE(@ReportsTo, ReportsTo),
             PhotoPath = COALESCE(@PhotoPath, PhotoPath)
         WHERE EmployeeID = @EmployeeID
    END
    GO

    That’s interesting. If I pass in nulls for everything, I get an update in place. Not quite what I’d do, as I’d check if the param was null and not include it in an update, which could reduce logging, but this is likely just as efficient.

    Easy code to write for sure, and I could likely put together a bit of code to do this for me, but it’s nice that I can quickly ask an AI to do this. I think this is the type of thing that might be easier for developers to do, and maybe more likely. They get to play with AI and feel more productive. They can even alter a table and “re-ask” for new procedures where they can interact with the table.

    What’s more, the INSERT procedures have the explicit column lists, so this means I could rev the underlying table without breaking this code. It’s a good coding practice, but far too many people would just embed a this in their code:

    insert Employee values ‘Jones’, ‘Steve’, ‘Editor’, …

    A quick thing, but Copilot seemed to work well here.

  • PASS Data Community Summit 2024 Day 3 Keynote

    It’s been an amazing week here, as well as a long week. I’m tired, as are many others. The blogging table is a little bare this am, but I do understand. Louis Davidson invited me to the Simple Talk breakfast and it was a struggle to get up, pack, and make it to the event. I was a little late, but I got there in time to catch Louis’ remarks.

    20241108_082924

    This morning the keynote opens with Ben Weissman, who gave last year’s community keynote with Melody Zacharias.

    I love that we have the previous year’s speaker introduce the next one. Ben tells us that he started growing his career here at the Summit, as have many others. Ben tries to help others grow and expand their careers, and I hope a few people get inspired to start blogging, speaking, and more. Most of us you see on stage started just like those of you in the audience.

    This is live-ish blogging, so apologies for typos. I’ve tried to italicize my thoughts.

    Privilege

    We are privileged to be here. Our companies invested in us, or we can afford it. We get the time to come. We get to interact with others in our industry, get some swag, enjoy the

    Ben thanks the DEIB committee, which does a lot of small things. The code of conduct, the non-alcoholic bar, gender neutral bathrooms and more. These items might not affect you, but they make the event better for others.

    There is also a New Stars track for new people who have never spoken. You can submit to this, which is a separate process from the main submissions. Ben runs New Stars of Data (with William Durkin) and he can help. He’s more than willing to help.

    He also thanks a lot of people in the community that helped him. I feel the same way, in that we work hard, but success comes with help from others.

    You might think others are doing much better than you. There certainly are those people, but there are also many more doing less well than you.

    Appreciate what you have and acknowledge your privilege. You don’t need to apologize for it, but don’t pretend it doesn’t exist.

    Generating Innovation

    Ginger comes out, asking about the media we used to watch. Gilligan’s Island for her, on a TV. Today, kids watch YouTube, Tiktok, etc., and on their phones. They watch things like this.

    2024-11_line0006

    Cable TV is going away, and a survey of younger people showed most thought this was going to happen.

    20241108_084426

    Today everyone talks about AI and that we might lose our jobs. Ginger thinks this is hype.

    But it is an important tool. Learn, innovate, be better.

    Netflix is the first example. They worked by mail, competing with Blockbuster. They took a chance on streaming, which I remember. Wondering if we could actually get enough bandwidth. Today Netflix dominated over others.

    First is not the most successful. Lots of tech was first, but hasn’t survived. Visicalc, Lotus 1-2-3 were first and everywhere, but they didn’t survive. Excel took over. They had a button to emulate Lotus, so that users could move. Excel innovated and won.

    You need to innovate and change to survive. Ben is the example. He was (is?) a VB6 developer. However, if he stuck there, he might not be on stage, in the community, owning a company, and more. He changed and innovated.

    That can be each of us. Ginger reminds us that other people help us grow, learn, get inspired, and do more. People are the reason companies innovate.

    Innovation requires curiosity, brave, and willing to fail. You have to take risks. If you start something new, you won’t be great, but you can learn and finds ways to innovate.

    SpaceX and musk shown. Why do some companies succeed in new ways? I think this is a great example, as this company changed the way rockets and space exploration works.

    Who remembers and awful job. Ginger’s gave her headaches every Sunday, in anticipation of going back to work Monday. She didn’t plan this, but found herself in the situation.

    We need to prepare for the future, be ready in advance. Explore your world, look at what’s important, what are others doing?

    I hear this a lot from people, but the devil is in the details, and I know that lots of people question what to do. I both agree with Ginger’s advice, and I don’t. A few years ago we were told we needed R. Lots of people, including me, spent time on R as it was added to SQL Server, ML was a big deal, and we saw others learning this.

    Today R isn’t something I see widely used. Python has taken over more, Databricks and Spark and other tech is being used more often, but will that continue? I don’t know.

    Ginger worked at a company she thought was good, but started to see people leaving because they weren’t valued and didn’t work on interesting things. Money wasn’t the reason, and I agree. I think back to Drive, which talks about Autonomy, Mastery, and Purpose. Monday matters, but those things bring more satisfaction (if the money is good enough).

    Ginger overworked herself at a job. She got sick, but thought she’d have done a good job. She asked why she was asked to do all the work in December.

    “did you get it done?”

    “She said yes, and the response was, “I guess I picked the right person for the job.”

    The boss felt he’d done a good job, but Ginger didn’t feel that way. She felt like she’d been abused and taken advantage of in the situation. She wasn’t valued. The same feeling of her friends.

    She left and that company failed. That company didn’t value employees. That could be us? Do we value our situations, our friends, our knowledge?

    I think that’s a decent analogy, because there are companies (that I know) and people who do continue to survive and do well even though they aren’t liked, or good, or anything. Sometimes they take advantage of the market (companies) or their situation/power (people) and others don’t like them but feel trapped. Or they constantly find new people that don’t know how toxic or unsatisfying it is around those people.

    I don’t know if those are exceptions, or if they’re the minority or even majority. I do know that those aren’t places I want to work, or people I want to spend time around. I also know there are lots of other opportunities.

    Ginger mentions pay, and that more pay doesn’t necessarily ensure you’ll enjoy the situation. I’ve learned that the hard way as well. I have often found that more pay isn’t better. I can get better pay and a better situation, but I can also accept slightly less pay and enjoy the situation more. Have I done this? Yes. I made $75k at one point and took a $68k job. It was totally work it.

    The Mississippi Miracle. After being ranked #50 in a 4th grade reading assessment (9-10yr olds), the US state found a new way to teach kids to read. They trained teachers, made an investment that was small, and they improved dramatically.

    I think this is a great example. A little investment in your career is what I ask. Not a part-time job investment, but a 1, 2, 4 hour a week investment. It can make a difference. I was talking to someone about blogging last night. I said you could write 1 small post a week. In a year, that’s 50 posts. That’s a lot of stuff to showcase about your career, a lot of practice to learn better communication skills, and a lot to learn about what you know or do. If you want a better year in a year or two, start now.

    Netflix had a recession, they laid off 30% of the company. They realized they had good people and had to let those people do work. They trusted them (autonomy), they asked them to work on things that helped the company (purpose), and gave them opportunities to showcase their knowledge and improve (mastery).

    If you haven’t read about things the Netflix engineers do, or seen talks from them, they have done amazing things. They innovate in tech. Their engineering blog is amazing, even though I don’t know most of the tech behind what they do. I’m frequently lost, but I also recognize these are very smart people getting things done.

    I’m not saying Netflix is amazing culturally, but they are impressive.

    Ginger notes she looked for opportunities and tried to find ways to get into a new department. They kept promising things, but never moved her, so she quit.

    Glassdoor, mentioning this is a good resource. One review, best thing is the food trucks outside because everything inside is garbage.

    Take Glassdoor with a grain of salt. There are always people who just gripe or are unhappy. My view is toss away 5% of the top and bottom reviews.

    It can be helpful in determining if you can trust the company and management.

    Training provides opportunity. If your employer provides them, great. If not, you need to do your own training. You want to create your own safety net for the future.

    I believe in this. In places resistant to investing, I usually do some, show what I’ve done and then ask for matching. That has worked in multiple situations.

    Ginger notes that she talked to someone who got upgraded on a flight. They talked to a manager/owner next to them. The owner noted their employees were in the back and that’s a bad message.

    Yes and no. Costs are a factor, and sometimes people get benefits because they travel a lot. I get upgraded and don’t apologize. I’ve had bosses that were in first while I was in coach because they had status and I didn’t. Or they spent money on an upgrade. I’ve also had bosses that use the same policy as employees. We do that at Redgate.

    Don’t get too black and white with specifics, look for trends. Fair and equal doesn’t always mean the same for everyone.

    What’s important to you? Talk to people to find out. Learn what matters to you. If you don’t like your situation, find a better situation and quit.

    It costs 150% of a person’s salary to replace them. Is that crazy? Think about all the time, all the effort, the work not being done, the training time. Ginger thinks this isn’t necessarily a bad number.

    Lat year a company gook their employees out to dinner at an expensive dinner at PASS. They then told the people because the food is expensive, they’d order family style and share. Made the employees think that management didn’t value them.

    I’d agree here. Don’t cheap out if you make the decision to spend money.

    Example of an employee that lives in S Dakota. The employee sends this person to a conference in Florida in December as a perk. He asks, chooses a time and place that suits him, and is happy. He’s still at the company.

    20241108_092520

    Good employees get more opportunities and more perks. It’s fair because they often provide more value to the company. Keep that in mind when you ask for something and it gets declined. Some managers are just jerks, but I often question myself and sometimes realize that I might not deserve something.

    Prompt Engineering

    Everyone needs to learn how to do this. Take a course, and it doesn’t take 6 hours. Do these things:

    • be specific about how much text in the answer (give me 5 things)
    • pick the persona you want to answer the questions (act as a travel agent)
    • ask for clarification from the previous question (give me more)
    • ask AI how to ask AI a question (how could I have asked this better)

    You can learn more by doing this. With generative AI, which generates responses, but also generates hallucinations. Because of this, ask for links and check them.

    Ginger showed her Dad how to follow this method with AI and he was surprised by his success.

    Go out and do good prompt engineering. This is a tool, and Ginger is more productive. It doesn’t do all her work, but it does help her. ZeroGPT is useful to find AI. Remind your kids about this.

    I use this and others. I don’t take AI stuff at SSC.

    Use tools, but remember we work with people and want to maintain our network. Remember the two rules:

    • The Golden Rule – treat others as you want to be treated.
    • Wheaton’s Law – Don’t be a jerk

    Most of us can imagine someone in our careers that didn’t obey Wheaton’s Law.

    I think about both of these often.

    Ginger reminds us that don’t just live in AI, remember to talk and work with people.

    Spend time with people who do what you want to do, learn from them, get inspired, and innovate for yourselves.

  • Using Copilot to help me update SQL Saturday

    An interesting AI experiment here with Copilot from GitHub in handling some code I don’t work with that often. Read on and watch.

    This is part of a series of experiments with AI systems.

    SQL Saturday Updates

    I keep the sqlsaturday.com site updated with code updates through GitHub. The repository is here: https://github.com/sqlsaturday/sqlsatwebsite

    I had hoped most organizers would fork this and use pull requests to update it, but surprisingly few data professionals are comfortable in Git. It’s fine, and I don’t mind.

    However, sometimes I get text updates that are a bit cumbersome to make. Recently I had someone send me a bunch of table text to update, and as I was editing, I realized that Copilot in VS Code had improved dramatically. You can watch below how it worked.

    Early in the Copilot days, I’d only get the next line added and sometimes the ending tag. Later, it started to suggest things, but from a guess standpoint, not reading what I’d pasted into the editor.

    Now, it’s really, really helpful.

    A cool way that AI can speed up your work, albeit one not a lot of data professionals might need.